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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
andreas789
Frequent Visitor

Divide cell by column total in a matrix visual

Hey, I need some help writing a DAX measure for a calculation.

 

I need to divide the net sales of any location (loc. code) for a specific Sap Group, by the sum of net sales in that Sap Group. 

andreas789_1-1643808913396.png

 

I have used the following measure but the problem is that it divides the net sales cell value by the net sales total value.

Net Sales SoB = 
DIVIDE(SUM(sales[NET_SALES]), CALCULATE(SUM(sales[NET_SALES]), ALLSELECTED()))

 

eg, for loc. code 100 and Sap Group 50-55, I want the net sales sob % to be 1.002.443,45 / 1.339.124,22 = ~75%

 

 

1 ACCEPTED SOLUTION
andreas789
Frequent Visitor

No special measure was required.

All I had to do was to change the following option from the field tab.

andreas789_1-1643827029677.png

 

View solution in original post

3 REPLIES 3
andreas789
Frequent Visitor

No special measure was required.

All I had to do was to change the following option from the field tab.

andreas789_1-1643827029677.png

 

Whitewater100
Solution Sage
Solution Sage

Hi:

I beleive you can change where it says ALLSELECTED to REMOVEFILTERS()

 

A lot of times I have a simple measure for sales like Sales Amount = SUM(Sales[Net Sales]) first then use 

DIVIDE([Sales Amount],

CALCULATE([Sales Amount], REMOVEFILTERS(Location[Code])))

 

another way can be:

DIVIDE(SUMX( Sales,[Net Sales), 
SUMX(ALLSELECTED(Sales), [Net Sales]))

Thanks for that but the result is not correct yet.

 

I need to divide column cell value by column total.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors