Forum Discussion
powerbihelp87
Helper V
6 years agoMIN and MAX else blank Row appears
I am trying to achieve a calculation where only the Max and Min value appear (so highest or lowest number in that category/material else show NA). I tried various DAX formulas but still could not fi...
- 6 years ago
Create measures
min = CALCULATE(MIN('Table'[Value]),ALLEXCEPT('Table','Table'[Material])) max = CALCULATE(MAX('Table'[Value]),ALLEXCEPT('Table','Table'[Material])) modified value = VAR mdvalue = IF ( MAX ( [Value] ) = [max] || MAX ( [Value] ) = [min], MAX ( [Value] ) ) RETURN IF ( ISINSCOPE ( 'Table'[Category] ), mdvalue, [max] - [min] )Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-juanli-msft
Community Support
6 years agoCreate measures
min = CALCULATE(MIN('Table'[Value]),ALLEXCEPT('Table','Table'[Material]))
max = CALCULATE(MAX('Table'[Value]),ALLEXCEPT('Table','Table'[Material]))
modified value =
VAR mdvalue =
IF (
MAX ( [Value] ) = [max]
|| MAX ( [Value] ) = [min],
MAX ( [Value] )
)
RETURN
IF (
ISINSCOPE ( 'Table'[Category] ),
mdvalue,
[max] - [min]
)
Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- powerbihelp876 years ago
Helper V
thank you so much for looking into this. v-juanli-msft the issue with the original requirements were that the categories are actually column names which wasn't best practice. I was able to acheive what I wanted by rethinking the visuals. thank you!!