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
MadBern85
Frequent Visitor

Moving cost from clients to company

Hi, somewhat new to PBI and still learning the ropes.

 

I have two measures concerning absence/illness connected to our clients and our company, one that calculates number of hours and one that calculates the cost. Like this:

 AbsenceHoursAbsenceCost
Client 137,51500
Client 212480
Client 3401600
Company10400
Total99,53980

 

Measures, if needed:

AbsenceHours = CALCULATE(SUM(Calculus [TotalHours]),FILTER(Hours,Hours[Type] = "Illness1 || Hours[Type] = "Illness2 || Hours[Type] = "Illness3 || Hours[Type] = "Illness4), FILTER('Salary', 'Salary' [SalaryCat] = "Paid"))

 

AbsenceCost = CALCULATE(SUM(Calculus[TotalCost]),FILTER(Hours,Hours[Type] = "Illness1 || Hours[Type] = "Illness2 || Hours[Type] = "Illness3 || Hours[Type] = "Illness4), FILTER('Salary', 'Salary' [SalaryCat] = "Paid"))

 

However, my goal is to only keep the number of hours at client level and have all the cost summarized under "Company".

Like this:

 AbsenceHoursAbsenceCost
Client 137,50
Client 2120
Client 3400
Company103980
Total99,53980

 

I can't figure out how to get this done. Can anyone give me some direction?

 

 

Thanks in advance.

Regards,

Mads

1 ACCEPTED SOLUTION
4 REPLIES 4
v-lionel-msft
Community Support
Community Support

Hi @MadBern85 ,

 

Please refer to my sample.

v-lionel-msft_0-1614913662331.png

 

Best regards,
Lionel Chen

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hi Lionel,

Thanks for the input, I'll check this out.

But I actually figured out the ISINSCOPE-solution and just implemented that.

 

Regards

Mads

@amitchandak , thanks for the tip, but I don't see the possible solution here with my current data model. ISINSCOPE seems to be dependent on hierarchies, and our clients and the company are on the same level in our database.

To get this to work, would I have to create a company column?

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.