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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Housden996
Helper II
Helper II

Sum of contract hours of a week with different Daily Hours

Hi

 

I have an issue where I am trying to get the sum of a some what dynamic weekly value of contract hours for a clinet which has a contract structure as follows:

Housden996_0-1715181753618.png

I also have some budgets which are only Mon-Fri or Sat-Sun.

I have managed to plot this into a line graph as well:

Housden996_1-1715181794337.png

My issue is now when I try to sum the budget of the week multiplying the value of the contrtacted hours (Example):

Housden996_2-1715181846074.png

Into a measure I get the following value:

Housden996_3-1715181874334.png

Using the DAX:

mPro-Rate Hours = SUM('Pro Rate Budget'[Daily Hours]) * COUNT('Period File'[Date])
 
Question: How in dax would I do this to get the dynamic value of 1117 instead of 1611? This needs to scale up with the amount of days selected from a date / week commencing slicer. Also this needs to not multiply / add out the dates when mon-Fri or Sat-Sun clients arnt working or are working.
 
Data info:  
 
I am joing the Budget file to the date file using a middle table to trigger the working days for each contact as following:
Working Days Working Period * <-->* Pro Rate Budget Working Days
Working Days Value *<-->* Period File Day of Week
Housden996_4-1715181991261.png

The working days table is as follows:

Housden996_5-1715182015771.png

 

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Housden996 , Try to use the date from the Working day  in a measure like

 

Sumx(values(WorkingDay[date]), calculate(SUM('Pro Rate Budget'[Daily Hours]) * COUNT('Period File'[Date]))  )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Housden996 , Try to use the date from the Working day  in a measure like

 

Sumx(values(WorkingDay[date]), calculate(SUM('Pro Rate Budget'[Daily Hours]) * COUNT('Period File'[Date]))  )

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.