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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

% of Total per team (relative to the overall total) by month

Hello Forum:

Ok, so here is what I am trying to do:

I have a stacked bar chart visual that I want to display the percentage of each team's monthly sales, compared to the overall sales for that month.  We have 5 teams.

Currently I can get part of this to work by using the following formula, and then selecting the option to "show value as percent of grand total".   When I do this, it does indeed show the percent of the total, for each team, relative to the overall total.  

 

SAM = CALCULATE('FLU_Shipped Orders'[Total Shipped Value],FILTER('FLU_Shipped Orders','FLU_Shipped Orders'[Salesperson Group]="SAMs"))


The problem occurs when someone used a filter to select one of the teams.  When they do, the bar then shows 100% in the stacked bar chart....rather than showing that particular team's percent versus the remaining total, which is what I need.  So for example, if a Team comprised 13% of the total sales for that month, I would want the stacked bar to show 13% (team) and 87% for the remaining teams (aggregated).  Or likewise, if two teams were selected in the filter, then those two teams respective % total would be shown in the stacked bar, with the third section of the bar showing the remainder.   For example,  Team 1  12%, Team 2  8%, then the remaining section of the bar would show 80%.

 

Thanks for any help!

2 REPLIES 2
kentyler
Solution Sage
Solution Sage

here is some sample code i found

EstimateCurrentMonth =
CALCULATE (
    SUM ( 'Sales'[Estimate] ),
    FILTER (
        ALL ( 'Sales'[MonthNumber] ),
        [MonthNumber] IN VALUES ( 'MonthParameter'[MonthParValue] )
    )
)
here the slicer is "MonthParameter", and its values are "MonthParValue"
your slicer would be based on your teams
this filters the sales table by whatever months are in the slicer and addes up the "estimate", you would be adding up the total shipped value.



 





Did this post answer your question? Mark it as a solution so others can find it!

Help when you know. Ask when you don't!




Join the conversation at We Talk BI find out more about me at Slow BI


Anonymous
Not applicable

Hi Ken, 

 

Unfortunately that does not seem to work.   It's not displaying the values as 100% of the full bar.   In other words, the total of the percents of the Teams does not equal 100%.   

 

And when I select the filter, it only shows the values (the team's monthly total) of whatever team is selected  and does not also show the remaining YTD value. 

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.