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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
sirlanceohlott
Advocate III
Advocate III

Office Allocation Count Issue

Good morning, 

 

I have an allocation by office requirement for a report, and with the help of @parry2k I've been able to get to the point where allocation by office works perfectly when placed into a table 🙌 

 

He provided a measure that worked perfectly in the sample file:

 

% allocated to office = 
VAR __totalOfficeinThisJob = CALCULATE ( COUNTROWS ( SampleData ), ALLEXCEPT ( SampleData, SampleData[jobOrderID] ) ) 
RETURN
DIVIDE ( 1, __totalOfficeinThisJob )

 

Unfortunately, the fact table holds multiple lines per JobOrder due to it having SubmissionIDs, Candidate IDs, so I had to make an adjustment to make the measure work, which is below: 

 

Allocated By Office = 
VAR __totalOfficeinThisJob = CALCULATE ( DISTINCTCOUNT( HI_JobOrder_BI_Fact[Office] ), ALLEXCEPT ( HI_JobOrder_BI_Fact, HI_JobOrder_BI_Fact[jobOrderID]))
RETURN
DIVIDE ( 1, __totalOfficeinThisJob ) 

 

The above measure allowed for the proper allocation to work due to the conditions of the fact table, so I created the below measure to SUM these new allocations:

 

Allocation Office Job Count = SUMX(HI_JobOrder_BI_Fact,[Allocated By Office])

 

The above measure works perfectly in a table where there is only one row per JobOrder (see below)

 

allocationcount1.PNG

 

 

But... When I utilize that same formula in my actual report the sums are extremely high which has me thinking it is counting everything...

 

allocationcount2.PNG

 

I'm needing another pair of eyes to help me turn the corner. 

 

I appreciate your help in advance 🙂

 

 

 

 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@sirlanceohlott update this measure as below, didn't had chance to review all the details but I think this will do it.

 

Allocation Office Job Count = 
SUMX(
VALUES( HI_JobOrder_BI_Fact[jobOrderId]),
[Allocated By Office]
)

 



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.

View solution in original post

4 REPLIES 4
parry2k
Super User
Super User

@sirlanceohlott update this measure as below, didn't had chance to review all the details but I think this will do it.

 

Allocation Office Job Count = 
SUMX(
VALUES( HI_JobOrder_BI_Fact[jobOrderId]),
[Allocated By Office]
)

 



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.

That did the trick, thank you thank you thank you 🙂

@sirlanceohlott glad to help. that was quick for you to test. Cheers!!



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 , I appreciate it, I'll let you know if the above adjustment makes it all click into place.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.