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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
Shaunes001
Regular Visitor

Possible newbie question about calculations in visuals

I'm having a bit of a frustrating problem with a visual in PowerBi. 

Screenshot 2024-09-12 094959.png

This is one of our cases, usually charged hours and time costs are filled but this simple case only has Costs.

I'm trying to get Net Profit to show it's actual total rather than the total subtracted from Amount Billed as we can have multiple cases together and we're measuring profitability.

The formula should be simple: 

[Amount Billed]-[Costs]
I've tried calculate, sum, I just can't get the total to actually show the total.
Any ideas? It's probably really simple and I'm missing something.
 
Many thanks in advance!
1 ACCEPTED SOLUTION

I managed to figure it out. I merged and the columns from the different sources in to the same table. However, I then had to clean up duplicates of values using this:

Measure = CALCULATE(MAX(Table[column]))
I then used that in my Visualization for each column that had duplicates in a Case.
I've also used:
Measure = SUMX(Table,Table[Column]) for values that need to be added together, like Costs.
(This is based on Timesheets per person per case, split by activity that also need to account for different consultants having different hourly rates, and expenses).
 
Got it working nicely now!

View solution in original post

8 REPLIES 8
v-zhengdxu-msft
Community Support
Community Support

Hi @Shaunes001 

 

Please try this:

Here I create a set of sample:

Table:

vzhengdxumsft_0-1726206051989.png

Then add a measure:

MEASURE =
SUMX ( 'Table', [Amount Billed] - [Costs] )

The result is as follow:

vzhengdxumsft_1-1726206123666.png

Best Regards

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

I managed to figure it out. I merged and the columns from the different sources in to the same table. However, I then had to clean up duplicates of values using this:

Measure = CALCULATE(MAX(Table[column]))
I then used that in my Visualization for each column that had duplicates in a Case.
I've also used:
Measure = SUMX(Table,Table[Column]) for values that need to be added together, like Costs.
(This is based on Timesheets per person per case, split by activity that also need to account for different consultants having different hourly rates, and expenses).
 
Got it working nicely now!
Shaunes001
Regular Visitor

Hi all,

Just to clear some details up. This is all in a visual, the details of each column is coming from different queries, for example amount billed comes from Sage, Costs are from a SharePoint list and the Case ID is from CRM. We use the Case ID as a common lynch pin data between each.

The calculation itself works perfectly fine and does everything it needs to do, but the total at the bottom shows the total of the calcualtion, not the calculation of the column like any other summary. 

dharmendars007
Super User
Super User

Hello @Shaunes001 , 

 

You can try the below measure..

 

If(Hasonefilter(CaseID), 
                                    [Amount Billed]-[Costs], 

                                    Sumx(Values(CaseID),  
                                                                [Amount Billed]-[Costs]))

 

If you find this helpful , please mark it as solution and Your Kudos are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

 

Hi Dharmendar,

I tried the formula you suggested but sadly I have the same result:

 

Screenshot 2024-09-12 115456.png

 

The total is still showing the calculation and not the total for the column

Hello @Shaunes001 ,

 

Sorry..Please try the below measure..

 

If(Hasonefilter(CaseID), 
                                    [Amount Billed]-[Costs], 

                                    Sumx(Values(CaseID),  
                                                                [Net Profit]))

 

If you find this helpful , please mark it as solution and Your Kudos are much appreciated!

 

Thank You

Dharmendar S

LinkedIN 

Sorry Dharmendar, I seem to be getting the same result. As mentioned, this is purely a visual and not a table, each column is coming from different sources. The calculation works as intended but the total is not correct.

Gabry
Super User
Super User

Please share some more details, like how is build amount billed measure

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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