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
setis
Post Partisan
Post Partisan

Measure*Measure

Hi experts!

 

I have a measure calculating the total costs

 

On a table with a list of customers I have a measure showing the %of activities generated by customer. 

 

I just want a measure to multiply the total costs * % of activities but the values that I'm getting are wrong. 

 

I'm using: AlocatedCosts = CALCULATE([TotalBalance]*[Percentage of Activities])

 

Could somebody point me in the right direction, please?

1 ACCEPTED SOLUTION

The calculations are actually right. 

 

I realized that I had a filter in my TotalBalance table and that's why I was getting wrong results. Thanks for your help. 

 

 

View solution in original post

4 REPLIES 4
AlB
Super User
Super User

Hi @setis

 

I think you'll need to provide some more details. What is it exactly that you are getting wrong? What values are you getting and what do you expect? What is the code for the measures you are using and where/how are you using them? Probably info on your data model will be necessary as well. What is the purpose of the CALCULATE in [AllocatedCosts] ?

 

Cheers

Sure!

 

The idea is to calculate the customer profitability. 

I have a list of fixed costs that I want to alocate based on the Nr of activites generated by customer. 

 

The relevant measures:

TotalBalance = SUM(Costs[Balance])

TotalActivities = COUNT(Activitied[CaseID])

Percentage of Activities = DIVIDE([ActivityCount];CALCULATE(Activities[ActivityCount];ALL(Customers_ACT[Customer])))
 
What I'm trying to do is (TotalBalance * Percentage of activities) on a line by line in order to alocate the costs on every customer based on the nr of activities on their cases. 
 
The measure that I'm trying is :
AlocatedCosts = SUMX(
                VALUES(Customers[Customer]);
                [TotalBalance]*[Percentage of Activities])
but the values obtained are wrong and the sum at the botom is not equal to the TotalBalance.
 
I hope that this makes sense. I would prepare a pbix as an example but one of my posts got marked yesterday as spam and I guess that it was due to a link to a google drive shared file. 

@setis 

 

Hmmm... sorry I still don't fully get it. I'd need to see the data model to see the relationships and check what is going on when the measures are invoked from the SUMX. I don't think posting the URL to a file would be a problem at all, it souldn't at least. Perhaps try with tinyupload.com or filedropper.com but I've seen many post with links to google drive      

The calculations are actually right. 

 

I realized that I had a filter in my TotalBalance table and that's why I was getting wrong results. Thanks for your help. 

 

 

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.