GROUPBY 的 COUNT 的 DAX 表达式

编程入门 行业动态 更新时间:2024-10-24 20:15:34
本文介绍了GROUPBY 的 COUNT 的 DAX 表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

我是 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 表达式

本文发布于:2023-10-30 11:59:22,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1542786.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:表达式   GROUPBY   COUNT   DAX

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!