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
Anonymous
Not applicable

Calculations with missing data

Hi,

I have got a simple table of student attendance (around 50 rows) looking as follows:

 

CourseGroupCourseCodePeriod 1 - ActualPeriod 1 - TargetPeriod B - ActualPeriod B - TargetPeriod C - ActualPeriod C - Terget
AZ0001255034584358
BZ0002152035403350
AZ0003122315251622
BZ00043040354533

50

 

I've created a measure for each period to calculate the percentage of achieving the target:

 
CalcPeriod1 = sumx( Registers_1920, Registers_1920[Actual 1] / Registers_1920[Target 1])
 
And set the formatting to % in the Modelling tab.
 
The measure works fine in a table for each course code.
 
If, however, I use the Matrix table by CourseGroup, it seems to be adding up the % (resulting in % higher than 100)
 
I would have thought that with the above measure, it would do the following:
For Course Group A: (25+12)/(50+23) which is what I'd like to do for the Matrix Table.
 
Please advise.
 
Thank you
 

 

 

1 ACCEPTED SOLUTION
hnguy71
Super User
Super User

@Anonymous 
I think there's a fundamental thing you have to do with your data modeling first. Unpivot your data into similar fashion:

unpivot.png

Next, you need to create generic measures:

TotalValue = SUM(School[Value])

Actuals = CALCULATE([TotalValue], School[Attribute] = "Actual") 

Targets = CALCULATE([TotalValue], School[Attribute] = "Target") 

Delta = DIVIDE([Actuals], [Targets])

And you should be able to achieve your desired results:
delta.png

If this is not the answer you were looking for please let me know.

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

View solution in original post

3 REPLIES 3
hnguy71
Super User
Super User

@Anonymous 
I think there's a fundamental thing you have to do with your data modeling first. Unpivot your data into similar fashion:

unpivot.png

Next, you need to create generic measures:

TotalValue = SUM(School[Value])

Actuals = CALCULATE([TotalValue], School[Attribute] = "Actual") 

Targets = CALCULATE([TotalValue], School[Attribute] = "Target") 

Delta = DIVIDE([Actuals], [Targets])

And you should be able to achieve your desired results:
delta.png

If this is not the answer you were looking for please let me know.

 



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!
Anonymous
Not applicable

Thank you. I've reorganised the data as you suggested. I'll play with it now.

Anonymous
Not applicable

Hi @Anonymous ,

 

Have your problem be solved? Please consider accept the answer as a solution if it worked.

 

Best Regards,

Jay

Community Support Team _ Jay Wang

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!

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.

Top Solution Authors
Top Kudoed Authors