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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
awolf88
Helper II
Helper II

Subtotal after Measure Calculation doesn't add up

Dear wizards,

 

I am - once again - having issue with incorrectly displayed subtotals I was hoping you could help me out with. 

It's a rather complex Data set that I don't wish to change as it functions beautifully up until this point. 

 

Perhaps I can simplify the problem in a few words and let you have a look at the demo-Data attached:

I have a table displaying different shops with different locations that purchase a mix of different items. I have a calculated measure for Projected total Sales of 2023 (green column). This seems to be aggregating just fine. 

awolf88_0-1681240615348.png

 Next to the green column i have this total Projected 2023 figure split into 3 Categories (1, 2, 3) - displayed in Blue. The values seem to be aggregating just fine per row as they should. Each row for itself adding up to 100%. 

 

Now for the last calculated columns in orange (Split by category) I break down the value of each row by according percentage (so Projected total * % Category 1 = category 1 split, projected Total * % category 2 = category 2 split, etc.). The values per row seem to aggregating accordingly, but if you have a closer look, you will notice that the subtotals per category split are completely off. 

I would need to fix it within the measure itself if that is anyhow possible. 

Perhaps one of you geniusses has an idea to get me back on the right track...

 

The one I'm currently going with looks like: 

awolf88_1-1681240885149.png

 

Here is the link to my demo-data via Dropbox:

https://www.dropbox.com/scl/fo/i6oeb9mvrypo4bawjwov1/h?dl=0&rlkey=vgd213f2hh34sf6aki42s62l7

 

 

Thank you so much for your input in advance!

 

Best,

Alex

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @awolf88 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure. 

C1 split =

var _a = SUMMARIZE('BudgetTable',[Customer Name],BudgetTable[Item Name],BudgetTable[Project Name],"Value",CALCULATE([Projected 2023],ALLEXCEPT('Calendar','Calendar'[MonthName]))*MIN('BudgetTable'[Category 1]))

return SUMX(_a,[Value])

(3) Then the result is as follows.

vtangjiemsft_0-1681370588008.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @awolf88 ,

 

According to your description, here are my steps you can follow as a solution.

(1) My test data is the same as yours.

(2) We can create a measure. 

C1 split =

var _a = SUMMARIZE('BudgetTable',[Customer Name],BudgetTable[Item Name],BudgetTable[Project Name],"Value",CALCULATE([Projected 2023],ALLEXCEPT('Calendar','Calendar'[MonthName]))*MIN('BudgetTable'[Category 1]))

return SUMX(_a,[Value])

(3) Then the result is as follows.

vtangjiemsft_0-1681370588008.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

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

Hi Neeko,

 

thank you so much for your assistance with this. Your coding worked like a charm for me.

 

Best regards and thanks again, 

Alex

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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