Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 57 | |
| 33 | |
| 33 | |
| 19 | |
| 18 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 45 | |
| 30 | |
| 28 |