如何在Power BI 中使用DAX 使用通配符筛选值来计算行数?

huangapple go评论136阅读模式
英文:

How to count row by filtering the value using wildcard using DAX in powerbi?

问题

我想通过使用两个筛选条件来计算一行。一个筛选条件使用通配符。我尝试了这个,但结果是计算了所有类别的行,看起来筛选条件没有起作用。

我要计算'BI - 22'[Category]等于Image and Data并且'BI - 22'[Creator]包含字符串Support的行数。

我是PowerBI的新手,有人可以给我一些建议吗?非常感谢,谢谢!

英文:

I would like to count a row by having 2 filter. 1 filter is using wildcard.
I tried this, but the result is calculate all the row of category, looks the filter is not working

IF(CONTAINSSTRING('BI - 22','BI - 22'[Creator]="*Support*", COUNTAX('BI - 22', 'BI - 22'[Category]="Image and Data")

I am going to count the row of 'BI - 22'[Category] when the value is equal to Image and Data and the 'BI - 22'[Creator] is contain of this string Support.

I am newbie with powerbi, anyone can give me idea please.
I really appreciate, thank you

答案1

得分: 1

以下是翻译好的部分:

Count = 
COUNTROWS(
    FILTER(
        'BI - 22',
        'BI - 22'[Category] = "Image and Data"
            && CONTAINSSTRING('BI - 22'[Creator], "Support")
    )
)

[![enter image description here][1]][1]


<details>
<summary>英文:</summary>

Here you go.

Count =
COUNTROWS(
FILTER(
'BI - 22',
'BI - 22'[Category] = "Image and Data"
&& CONTAINSSTRING('BI - 22'[Creator], "Support")
)
)

[![enter image description here][1]][1]


  [1]: https://i.stack.imgur.com/3ifL0.png

</details>



huangapple
  • 本文由 发表于 2023年3月8日 17:59:39
  • 转载请务必保留本文链接:https://go.coder-hub.com/75671593.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定