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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Calculating top 2 box percentage and mean

Would like some help on the DAX measures to calculate top 2 box percentage for survey data as well as the mean.

 

Top 2 box is just for people who rated 4 or 5 from a scale of 1-5.
Mean has to be calculated by considering weights and rating scale as a factor for calculation

ajinkya_1999_0-1636972597380.png

 

WT is the weights column, top 2 box percentage has to be calculated for columns L onwards,

 

 

3 REPLIES 3
v-angzheng-msft
Community Support
Community Support

Hi, @Anonymous 

 

You could try this measure

Measure =
DIVIDE (
    CALCULATE (
        COUNT ( 'Table'[satisfaction_v2] ),
        FILTER ( 'Table', 'Table'[satisfaction_v2] IN { 4, 5 } )
    ),
    CALCULATE ( COUNT ( 'Table'[satisfaction_v2] ), ALLSELECTED ( 'Table' ) )
)

Result:

vangzhengmsft_0-1637201435373.png

Please refer to the attachment below for details. Hope this helps.

 

If this doesn't work for you, then please consdier sharing more details about it and posting expected result so it is clear on what needs to be implemented?  And It would be great if there is a sample file without any sesentive information here.  It makes it easier to give you a solution.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

amitchandak
Super User
Super User

@Anonymous , Try one of the two

 

example

 


divide(calculate(count(Table[Row]), filter(Table, Table[Rating] in {4,5} )) ,calculate(count(Table[Row])))


divide(calculate(count(Table[Row]), filter(Table, Table[Rating] in {4,5} )) ,calculate(count(Table[Row]), allselected()))

Anonymous
Not applicable

Hey, I was trying the first measure and was typing this out:

Measure = DIVIDE(COUNT(AirlineCSATSurvey[satisfaction_v2]),FILTER(AirlineCSATSurvey,AirlineCSATSurvey[satisfaction_v2]in{4,5}))
 
however the " ,calculate" part is not being accepted in the measure is being highlighted with red underlines

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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