The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi, I'm quite new to Power BI and am looking for a way to count the number of times a value appears in one specific column and output the value name along with the frequency it occurs.
For example if my column has:
Apple
Apple
Banana
Orange
Orange
and it should output:
Apple 2
Banana 1
Orange 2
I've done this using Query Tool but I'm looking for a way to do so via DAX. Thanks!
Hi @datashock ,
You can refer to DAX calculation :-
Term Count =
VAR vTerm = Table1[Term]
VAR vResult =
COUNTROWS ( FILTER ( Table1, CONTAINSSTRING ( Table1[Title], vTerm ) ) )
RETURN
vResult
Thanks,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
Proud to be a Super User!
Hi pratyashasamal, this hasn't worked for me. Do I need to replace both Term and Title with the name of my column I want to get the values for?
Hi @datashock ,
Please replace the the column names and Tables Names .
It was just an example.
Thanks ,
Pratyasha Samal
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
Proud to be a Super User!
Hi @pratyashasamal yes I know I need to replace them but it's not clear what goes where, eg is 'Term' referring to my column name? What about 'Title'? I know that Table1 refers to the table. Thanks.