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
Browncorinne
Regular Visitor

How can I rank the questions based on survey response yes

How can I rank the chart below based on the survey question with the most "Yes" question.  

I would also like to identify the top 5 (most yes) /bottom 5 (most no) questions out of the 65 questions

 

Browncorinne_0-1661168867668.png

 

1 ACCEPTED SOLUTION
v-yangliu-msft
Community Support
Community Support

Hi  @Browncorinne ,

I created some data:

vyangliumsft_0-1661402162792.png

Here are the steps you can follow:

1. Create measure.

Rank =
IF(
    MAX('Table'[Group1])="Yes",
RANKX(FILTER(ALL('Table'),'Table'[Group1]="Yes"),CALCULATE(SUM([Count])),,DESC,Dense))
IF =
IF(
    [Rank] <=5&&[Rank]<>BLANK(),1,0)
Flag =
var _select=SELECTCOLUMNS(FILTER(ALL('Table'),[IF]=1),"1",[Group])
return
IF(MAX('Table'[Group]) in _select,1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1661402162796.png

3. Result:

vyangliumsft_2-1661402162803.png

If you need pbix, please click here.

How can I rank the questions based on survey response yes.pbix

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

View solution in original post

4 REPLIES 4
v-yangliu-msft
Community Support
Community Support

Hi  @Browncorinne ,

I created some data:

vyangliumsft_0-1661402162792.png

Here are the steps you can follow:

1. Create measure.

Rank =
IF(
    MAX('Table'[Group1])="Yes",
RANKX(FILTER(ALL('Table'),'Table'[Group1]="Yes"),CALCULATE(SUM([Count])),,DESC,Dense))
IF =
IF(
    [Rank] <=5&&[Rank]<>BLANK(),1,0)
Flag =
var _select=SELECTCOLUMNS(FILTER(ALL('Table'),[IF]=1),"1",[Group])
return
IF(MAX('Table'[Group]) in _select,1,0)

2. Place [Flag]in Filters, set is=1, apply filter.

vyangliumsft_1-1661402162796.png

3. Result:

vyangliumsft_2-1661402162803.png

If you need pbix, please click here.

How can I rank the questions based on survey response yes.pbix

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly

Browncorinne
Regular Visitor

@Greg_Deckler - Thanks for responding.  I tried the formulas, but I get an error -  I am trying to sum the responses - Yes, Partial, No, NA. 

Browncorinne_1-1661205287478.png

 

@Browncorinne You can't sum strings (text). So, for some reason, you are trying to sum up text values which is likely to not work very well.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...
Greg_Deckler
Super User
Super User

@Browncorinne See if this article on RANKX helps. To *Bleep* with RANKX! - Microsoft Power BI Community


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

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.

Top Solution Authors