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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Ranking Column headings based on frequency of a value in the column

 

Hi, 

 

I have the table in PowerBI similar to the one below. 

What I'm aiming to do is rank the Column Headings based on the frequency of a value in the column.

For example, frequency of the text "Fail" in column B is 4, frequency of "Fail" in column C is 2, frequency column D is 1, column E is 5

Rank would be:

1. Is this cool?

2. Is this suitable?

3. Is this compliant?

4. Is this realistic?

thumbnail_image001.png

 

I've created a measure for each column to count the number of "Fail" 

FAILCOUNT = CALCULATE(COUNTROWS('table'),'table'[Is this sitable?]="Fail")

 

I'm not sure where to go from here..any advice would be great.

 

Thanks

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Anonymous 

in PQ, select ID column and unpivot other columns

1.png2.PNG

create a measure

 

failcount = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Value]="Fail"))

rank = RANKX(ALLSELECTED('Table'[Attribute]),[failcount],,DESC)

 

4.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

1 REPLY 1
ryan_mayu
Super User
Super User

@Anonymous 

in PQ, select ID column and unpivot other columns

1.png2.PNG

create a measure

 

failcount = CALCULATE(COUNTROWS('Table'),FILTER('Table','Table'[Value]="Fail"))

rank = RANKX(ALLSELECTED('Table'[Attribute]),[failcount],,DESC)

 

4.PNG





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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