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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
FilipFireFlyBI
Resolver I
Resolver I

Use SUMMARIZE not as calculated table but in a measure

I have a simple star scheme (dimdate, dimemployee, factworkschedule).
In factworkschedule I have 3columns: EmployeeID, workdate, Activitytype (1 = working, 2 = break etc. 9 = Sickleave). For this question only 1 (working day) and 9 (sickleave day) are relevant.
I want to calculate the sickleave% for the whole company (so all employees for the whole month). 

I can succesfully do this using a calculated table with SUMMARIZE (table DAX calculated table , see example attached), creating 2 additional relations in the model, and then measure (Sickleave rate) that uses this calculated table.

I dont like the additional calculated table, I only want to use measure(s). How can I do that?

Note that my solution uses SUMMARIZE, but this is not required (use what you think is best).

The end result should be a % with the  sickleave days / workdays, and should be visible per week/day/month and employee/whole company.

See below picture, so I dont want the calculated table and the 2 relations.

See here my datamodel on my Dropbox account: https://www.dropbox.com/s/q3m3zm0b4tzds8o/Sickleave%20rate.pbix?dl=0

 

Thanks in advance!

Filip

 

Summarize table.JPG

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You can use SUMMARIZE within a measure definition but I don't think its necessary in this situation. Try

Sick Leave % = 
var sickDays = CALCULATE( COUNTROWS( Workschedule), Workschedule[activitytypeid] = 9 )
var totalDays = CALCULATE( COUNTROWS( Workschedule), Workschedule[activitytypeid] IN {1, 9} )
RETURN DIVIDE( sickDays, totalDays)

View solution in original post

2 REPLIES 2
FilipFireFlyBI
Resolver I
Resolver I

Thanks Johnt75,

 

This is a clean/fast solution!

Regards Filip

johnt75
Super User
Super User

You can use SUMMARIZE within a measure definition but I don't think its necessary in this situation. Try

Sick Leave % = 
var sickDays = CALCULATE( COUNTROWS( Workschedule), Workschedule[activitytypeid] = 9 )
var totalDays = CALCULATE( COUNTROWS( Workschedule), Workschedule[activitytypeid] IN {1, 9} )
RETURN DIVIDE( sickDays, totalDays)

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors