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?
You can do something similar in Power BI as follows:
SUMMARIZE(Tags, Tags[value], "TagCount", COUNT(Tags[value]))
or
SUMMARIZECOLUMNS(Tags[value], "TagCount", 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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With