Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hello All,
I am trying to create a column which compares all values to Net Sales. Our company calculates Net Sales as Gross Sales - Returns and Discounts. The picture below is what I'm trying to achieve: Net Sales are 150 and I'm trying to compare every other total to that value.
I'm sure there is a simple way to do this but every way I have tired does not give me the results I want. I have created two measures, the first one calculates Net Sales:
The next calculates the posted amount over the Net Sales measure:
I have also tried a different version of the above formulas:
Below are the results I'm getting based off of the formulas above. As you can see it's not dividing by the total Net Sales and in the case of the lower rows, it's dividing by 0 because they aren't in the net sales calculation.
Any insight would be greatly appericated.
Thanks,
Calen
Solved! Go to Solution.
Hi @calen ,
You could use ALLSELECTED( 'Your table' ). Here is a measure for your reference.
Measure =
VAR a =
CALCULATE (
SUM ( 'Table'[Posted Amount] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Row No.] IN { 4010, 4020, 4030, 4035, 4040 }
)
)
VAR b =
ABS ( SELECTEDVALUE ( 'Table'[Posted Amount] ) ) / a
RETURN
b
Here is the result:
Hi @calen ,
You could use ALLSELECTED( 'Your table' ). Here is a measure for your reference.
Measure =
VAR a =
CALCULATE (
SUM ( 'Table'[Posted Amount] ),
FILTER (
ALLSELECTED ( 'Table' ),
'Table'[Row No.] IN { 4010, 4020, 4030, 4035, 4040 }
)
)
VAR b =
ABS ( SELECTEDVALUE ( 'Table'[Posted Amount] ) ) / a
RETURN
b
Here is the result:
Thank you for your help!
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.