Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
k1s2
Helper I
Helper I

Count number of times specific value appears in each row across columns whose name contains

 
How do I create a DAX formula for a caculated column that counts the number of times the cell value = "High" across column names ending with the text "Rating"?
4 REPLIES 4
k1s2
Helper I
Helper I

Thanks for your reply, 

 

I tried unpivoting, all except the unique ID column, then filtered 'Attribute' for column names ending in "Rating", then filtered 'Values' for "High", then grouped by unique ID and got a new 'Count' column...

...but lost all the original columns. How do I get them back along with the new Count column? 

@k1s2 I was talking about a DAX solution. You unpivot and then write the appropriate DAX.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

After I unpivot in Power Query, what would be the way to count using DAX?  

I have ~400 columns, of which 114 end in the word "Rating", the values of which sometimes contain the word "High".  I'm looking to avoid building a DAX measure that has to names each of the columns individually.

Greg_Deckler
Community Champion
Community Champion

@k1s2 Generally you would unpivot those columns. Or, you could use MC Aggregations: Multi-Column Aggregations (MC Aggregations) - Microsoft Fabric Community

 

Otherwise, in Power Query, I would do what you did in terms of transformation as a custom function and then use that function in a custom column.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.