Intellipaat Back

Explore Courses Blog Tutorials Interview Questions
0 votes
2 views
in BI by (17.6k points)

I am new to PowerBI and writing DAX expressions.

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

Any help? 

closed

1 Answer

0 votes
by (47.2k points)
selected by
 
Best answer
  • We can use either of these

SUMMARIZE(Tags, Tags[value], "TagCount", COUNT(Tags[value]))

(or)

SUMMARIZECOLUMNS(Tags[value], "TagCount", COUNT(Tags[value]))

  • We can even do this as a matrix visual with Tags[value] for the Rows and the measure COUNT(Tags[value]) for the values and then sort by whichever column you choose by clicking the column heading on the visual.

Related questions

0 votes
1 answer
asked Nov 4, 2020 in BI by Sudhir_1997 (55.6k points)
0 votes
1 answer
0 votes
1 answer
asked Jul 10, 2019 in BI by Vaibhav Ameta (17.6k points)

31k questions

32.8k answers

501 comments

693 users

Browse Categories

...