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
Rabi
Resolver I
Resolver I

Distributing Hours to the facilities from a Facility.

Hi Everyone,

 

Please help me with the following issue:

I used this dax to calculate the Maintenance Hours

 

 

 

 

Maintenance Hours (Head Office) =
           var Hours= CALCULATE( SUM (Table A [Hours] )
          , Table A [Department] IN { "Maintenance" },
          Table A '[Village Name]="Head Office") 
return 
CALCULATE(Hours,REMOVEFILTERS(Table A[Village Name]))

 

 

 

 

 Now i need to distribute the resulting hours from above dax to other villages, i used the following dax but its not working as i have specified the Head Office in above dax, how can i make the resuting hours from above dax to act as hard value. I am distributing the hours based on the bed capacity of the villages

 

 

 

 

Head Office distribution Maintenance = 
VAR totalbed = CALCULATE(SUM(Table B[Bed Capacity]),
 ALLSELECTED(TABLE A[Village Name]))

VAR EachFacilityBeds = SUM(Table B[Bed Capacity])
RETURN
[Maintenance Hours (Head Office)]*EachFacilityBeds)/totalbed

 

 

 

 

I used the following Measure in a matrix but it doesnt give me the distributed hours, If i use the hard value like below then i get the corrrect distribution

 

 

 

Head Office distribution Maintenance = 
VAR totalbed = CALCULATE(SUM(Table B[Bed Capacity]),
 ALLSELECTED(TABLE A[Village Name]))

VAR EachFacilityBeds = SUM(Table B[Bed Capacity])
RETURN
(3500*bed)/totalbed

 

 

3500 is the resulting value from the first measure.

 

@parry2k  @Greg_Deckler @lbendlin 

5 REPLIES 5
parry2k
Super User
Super User

@Rabi also do you want these as columns or measures? If you want columns I would do it in PQ, but if need measures then of course it will be DAX. 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi Parry, 

I would prefer dax over PQ however, i am keen ko learn how would it be done in PQ, the hours can be divided in equal portions.

 

Thanks Very Much !!

parry2k
Super User
Super User

@Rabi 40 hours from h/o distributed to other facilities in equal portion or there are other strings attached?



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@Rabi very hard to tell what you are trying to achieve. It will be easier if you throw a sample pbix file or sample data with the expected output. Measures are not explaining much, at least to me. Thanks!



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Hi Parry, 

Below is the sample data,

I want to Distribute the 40 hours from Head office to the villages A,B,C,D,E, The result would be 8 hours distributed to each villages. I have used same logic above.

 

Thanks !!

 

FacilityJob TitleWorked HrsAmount 
AMaintenance8100
B

Maintenance

8100
CMaintenance8100
DMaintenance8100
EMaintenance8100
Head OfficeMaintenance40500

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!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

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