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.
amitchandak
Super User
6 years agoYou can create a new column or measure like this
max(max(max([Category A],[Category B]),[Category C]),Category D) -
min(min(min([Category A],[Category B]),[Category C]),Category D)
. But you make sure the Data type is the same. NA is not allowed
- powerbihelp876 years ago
Helper V
thank you!