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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Housden996
Helper I
Helper I

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 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]))  )

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.