我是 PowerBI 和编写 DAX 表达式的新手.
I am new to PowerBI and writing DAX expressions.
我有一个带有不同值的文本列的表.我要做的就是获取每个不同值的计数.使用此 SQL 很容易实现,但我无法获得正确的 DAX 表达式.
I have a table with a text column with different values.All I want to do is get the count for each distinct value. It's easily achieved with this SQL but I can't get the right DAX expression for it.
select [value],count(*) as TagCount from Tags group by [value] order by TagCount desc有什么帮助吗?
推荐答案您可以在 Power BI 中执行类似的操作,如下所示:
You can do something similar in Power BI as follows:
SUMMARIZE(Tags, Tags[value], "TagCount", COUNT(Tags[value]))或
SUMMARIZECOLUMNS(Tags[value], "TagCount", COUNT(Tags[value]))您也可以将其作为矩阵视觉对象,使用 Tags[value] 表示行,使用度量 COUNT(Tags[value]) 表示值.然后,您可以通过单击视觉对象上的列标题按您选择的任何列进行排序.
You can also do this as a matrix visual with Tags[value] for the Rows and the measure COUNT(Tags[value]) for the Values. You can then sort by whichever column you choose by clicking the column heading on the visual.
更多推荐
GROUPBY 的 COUNT 的 DAX 表达式
发布评论