0 votes
1 view
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.5k points)
0 votes
1 answer
Welcome to Intellipaat Community. Get your technical queries answered by top developers !

Categories

...