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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Applicable88
Impactful Individual
Impactful Individual

Change denominator based on selection in a measure

Hello,
I have a bar chart, where I calculate the workload of a machine perday in %.
I basically sum the amount of the duration in seconds, and using the Divide() function to divide it with a "fix" value of
86400 which equals 24hours:
 
WorkloadPerDay =
DIVIDE(CALCULATE(SUMX('Machine','Machine'[Duration])),86400)
 
The problem I have is when I select nother category in the slicer for "early shift", "late Shift" or "night Shift", I only sum the duration of that selected shift, but its still divided through one day, hhence 86400 seconds. Instead of the time of  just one shift 8hours = 28800 seconds or two shifts.
Is there away to put that all into one measure without the need of unhandy bookmarks and so fourth?
Thank you very much in advance.
Best. 
 
 
 
1 ACCEPTED SOLUTION
Applicable88
Impactful Individual
Impactful Individual

@AntoineTRICHET thanks for your input. I found a method where also a selection of two works perfectly. Its to put another column next to the shift where I have the seconds 28800 for every shift. And then use sum(shiftperseconds). 

Best. 

View solution in original post

2 REPLIES 2
Applicable88
Impactful Individual
Impactful Individual

@AntoineTRICHET thanks for your input. I found a method where also a selection of two works perfectly. Its to put another column next to the shift where I have the seconds 28800 for every shift. And then use sum(shiftperseconds). 

Best. 

AntoineTRICHET
Resolver III
Resolver III

Hi @Applicable88 

You can use SELECTEDVALUE function and do tests (works only if you select one shift).
Another solution is to put in denominator "28800 * COUNTDISTINCT(ShiftType)".
Here ShiftType refers to your column containing the type of shift.

Please accept it as a solution if it solved your issue or provide more details if not

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.