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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

% Sales contribution calculation Weekly

Hi,

 

I need to calculate the percentage of weekly sales contribution.

Sales contribution= W1/W1+W2+W3+W4+W5 

 

In the calculation the slicer should filter the sales and total contribution should be always 100% upon multiple month or groupcode selection.

 

Ex- W1, W2, W3, W4, W5 sales of Jan should 100% and Dec should be 100% individually even if multiple months are selected. The slicer should also function based upon multiple selection of Groupcode and month also.

 

priyamsachan12_0-1711431023123.pngpriyamsachan12_1-1711431108133.png

 

1 ACCEPTED SOLUTION

The context of where you use the measure will be important.  Because of the "ALLEXCEPT" line, if you give it a context where both JAN and FEB exist in the same context, your denominator is going to be JAN + FEB.

I'd expect you'd want to use this measure on a table where you have row contexts for JAN and FEB separately.

If you are selecting a context where JAN and FEB are both present, how are you expecting to aggregate the output?  Like if Jan was 99% and Feb was 90%, what total value would you expect your measure to produce?

View solution in original post

3 REPLIES 3
RossEdwards
Solution Sage
Solution Sage

I'm assuming that GroupCode needs to be kept in your context filters.  If i understand what you are asking for, you want this?

Contribution Sales = 
var weeklySales = SUM('Sales Contribution'[Sales])
var totalMonthSales = CALCULATE(
    SUM('Sales Contribution'[Sales]),
    ALLEXCEPT('Sales Contribution'[GroupCode]), 'Sales Contribution'[MonthYear])
)
RETURN
DIVIDE(weeklySales, totalMonthSales)

 

Anonymous
Not applicable

@RossEdwards 

 

Now using your measure, 

 

Upon multiple year selection, the sum of % contribution of Jan & Dec Individually is not 100%.

Instead, it is 100% upon summation of both months.

priyamsachan12_0-1711437808004.png

 

Expectation: % contribution sales of Jan should be 100% and Dec should also be 100% contribution.

 

The context of where you use the measure will be important.  Because of the "ALLEXCEPT" line, if you give it a context where both JAN and FEB exist in the same context, your denominator is going to be JAN + FEB.

I'd expect you'd want to use this measure on a table where you have row contexts for JAN and FEB separately.

If you are selecting a context where JAN and FEB are both present, how are you expecting to aggregate the output?  Like if Jan was 99% and Feb was 90%, what total value would you expect your measure to produce?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.