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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
TFTF_BI
Helper I
Helper I

Categorising into groups using a result from a calculated measure to use in a visual.

Hi Guys, Im stuck on the below. 

 

So I have a measure which gives me a total average percentage of increase or decrease.

Example:

 

(Im comparing students attendance against 2 time frames. 'this part works fine' )

 

Time frame 1 = 70% average over 20 students 

Time frame 2 = 90% average over the same 20 students

giving me an average increase of 28.5% 

 

My measure called (attandance_variance) gives my 28.5% when comparing the dynamic time frames selected.

 

I also have now got a working measure that tells me how many students within this measure have improved. shown below: 

 

Count_Students_Attendance_Improved =

VAR Count_Improved = COUNTX(
FILTER(
VALUES(Students[school_student_id]),
'Measures'[Difference_Attendance_Percentage]>0),
Students[school_student_id])

Return Count_Improved
 
This is working great and tells me that 7/20 students have improved.
 
What I am struggling with is if I want to see this result in a visual like a pie chart in catorgories for example: 
 
7/20 Improved (>0.05)
3/20 Did not significantly change (>-0.05 & <0.05)
10/20 Did not improve (<-0.05)
 
I deally I would like to drop a measure into a visual and it will break it down into the 3 catorgories for me. 
 
I would love some help in solving this problem.
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi  @TFTF_BI ,

Here are the steps you can follow:

1. Create calculated column.

Flag =
SWITCH(
    TRUE(),
    'Table'[Count_Students_Attendance_Improved]=0.15,"Did not significantly change (>-0.05 & <0.05)",
   'Table'[Count_Students_Attendance_Improved]=0.5,"Did not improve (<-0.05)",
    'Table'[Count_Students_Attendance_Improved]=0.35,"Improved (>0.05)")

2. Create measure.

Improved =
COUNTX(FILTER( 'Table','Table'[Flag]="Improved (>0.05)"),[Flag])
Did not improve =
COUNTX(FILTER( 'Table','Table'[Flag]="Did not improve (<-0.05)"),[Flag])
Did not significantly change =
COUNTX(FILTER( 'Table','Table'[Flag]="Did not significantly change (>-0.05 & <0.05)"),[Flag])

3. Result:

vyangliumsft_0-1647836565117.png

 

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

1 REPLY 1
Anonymous
Not applicable

Hi  @TFTF_BI ,

Here are the steps you can follow:

1. Create calculated column.

Flag =
SWITCH(
    TRUE(),
    'Table'[Count_Students_Attendance_Improved]=0.15,"Did not significantly change (>-0.05 & <0.05)",
   'Table'[Count_Students_Attendance_Improved]=0.5,"Did not improve (<-0.05)",
    'Table'[Count_Students_Attendance_Improved]=0.35,"Improved (>0.05)")

2. Create measure.

Improved =
COUNTX(FILTER( 'Table','Table'[Flag]="Improved (>0.05)"),[Flag])
Did not improve =
COUNTX(FILTER( 'Table','Table'[Flag]="Did not improve (<-0.05)"),[Flag])
Did not significantly change =
COUNTX(FILTER( 'Table','Table'[Flag]="Did not significantly change (>-0.05 & <0.05)"),[Flag])

3. Result:

vyangliumsft_0-1647836565117.png

 

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

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.