Turn on suggestions

Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Microsoft Power BI Community
- Forums
- Get Help with Power BI
- Desktop
- Re: The subtotal of the matrix is not applying the...

Topic Options

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page

Highlighted

angelikamariae

Frequent Visitor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-09-2020
10:53 AM

Hi all.

I am trying to present the GM calculation in a matrix.

the formula for the GM meassure is

GM = divide([Margin],[ActualSales],0)

as you can see for J005384 and J005647 it is showing right, but if you see the total in revenue is showing the sum of those two instead of following the formula. I would expect it to show me 100% since it should follow the formula in each row... I have tried different things but nothing seems to work. Could some one help pls?

Solved! Go to Solution.

1 ACCEPTED SOLUTION

Accepted Solutions

Highlighted

angelikamariae

Frequent Visitor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-10-2020
09:13 AM

Hi Greg

thanks a lot for your quick answer.

I went to your link and it looks that it is the great solution for this common problem.

I just solved in a way that for my case I found a bit simpler.

This is what I did:

Before I had 'Margin' as a column I created in the query editor. then I changed for a measure instead like this:

Margin = CALCULATE(sum(JobCost[ActualSales]))-calculate(sum(JobCost[ActualCost]))

then I created a measure called GM with like follows

GM = divide([Margin],sum(JobCostFull[ActualSales]),0 )

just doing that made the magic for me and my totals went according to the formula.

Angelica

4 REPLIES 4

Highlighted
##

---------------------------------------

*Putting square pegs in round holes since 1972.*

##### I have a NEW book!

DAX Cookbook from Packt

Over 120 DAX Recipes!

**Did I answer your question? Mark my post as a solution!**

Greg_Deckler

Super User IV

Re: The subtotal of the matrix is not applying the formula for the total of the Measure, but the sum

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-09-2020
10:54 AM

This looks like a measure totals problem. Very common. See my post about it here: https://community.powerbi.com/t5/DAX-Commands-and-Tips/Dealing-with-Measure-Totals/td-p/63376

Also, this Quick Measure, Measure Totals, The Final Word should get you what you need:

https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907

---------------------------------------

DAX Cookbook from Packt

Proud to be a Super User!

Highlighted
##

V-lianl-msft

Microsoft

Re: The subtotal of the matrix is not applying the formula for the total of the Measure, but the sum

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-10-2020
01:42 AM

Hi @angelikamariae ,

You can refer to what @Greg_Deckler said before.

If the problem persists,could you please share a PBIX file with dummy data?(using OneDrive for Business)

Best Regards,

Liang

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

Highlighted

angelikamariae

Frequent Visitor

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-10-2020
09:13 AM

Hi Greg

thanks a lot for your quick answer.

I went to your link and it looks that it is the great solution for this common problem.

I just solved in a way that for my case I found a bit simpler.

This is what I did:

Before I had 'Margin' as a column I created in the query editor. then I changed for a measure instead like this:

Margin = CALCULATE(sum(JobCost[ActualSales]))-calculate(sum(JobCost[ActualCost]))

then I created a measure called GM with like follows

GM = divide([Margin],sum(JobCostFull[ActualSales]),0 )

just doing that made the magic for me and my totals went according to the formula.

Angelica

Highlighted
##

angelikamariae

Frequent Visitor

Re: The subtotal of the matrix is not applying the formula for the total of the Measure, but the sum

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

03-10-2020
09:17 AM

Thanks Liang.

I just posted what solved the problem for me in this case.

Even though what Greg said was very good to know for the future.

It looks like I wasnt the only one strugling with this 🙂

have a good day

Angelica.

Announcements

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

Visit our Community Blog for articles, guides, and information created by fellow community members.

Wondering what events you could join or have an event to promote yourself? Check out our Upcoming Events.

Top Solution Authors

User | Count |
---|---|

349 | |

123 | |

88 | |

86 | |

85 |

Top Kudoed Authors

User | Count |
---|---|

466 | |

182 | |

171 | |

129 | |

117 |