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.
Hello,
I need do select two cenarios in ONE filter and have the subtraction of the sum of each of then.
Like, if I select A and B, it would be (1+2+3)-(4+5) = -3
Thanks!
Cenario | Value |
A | 1 |
A | 2 |
A | 3 |
B | 4 |
B | 5 |
C | 6 |
C | 6 |
Solved! Go to Solution.
Hi @Anonymous ,
You need to change something in @amitchandak 's expression, you could try below expression
Measure =
VAR _min =
MINX ( 'Table', 'Table'[Cenario] )
VAR _max =
MAXX ( 'Table', 'Table'[Cenario] )
RETURN
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table' ), 'Table'[Cenario] = _min )
)
- CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table' ), 'Table'[Cenario] = _max )
)
You could refer to my sample for details.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You need to change something in @amitchandak 's expression, you could try below expression
Measure =
VAR _min =
MINX ( 'Table', 'Table'[Cenario] )
VAR _max =
MAXX ( 'Table', 'Table'[Cenario] )
RETURN
CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table' ), 'Table'[Cenario] = _min )
)
- CALCULATE (
SUM ( 'Table'[Value] ),
FILTER ( ALL ( 'Table' ), 'Table'[Cenario] = _max )
)
You could refer to my sample for details.
Best Regards,
Zoe Zhi
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Try like
Measure =
var _min = minx(Table,Table[Cenario])
var _max = maxx(Table,Table[Cenario])
return
calculate(Table[Value],filter(all(Table),Table[Cenario]=_min))- calculate(Table[Value],filter(all(Table),Table[Cenario]=_max))
or
Measure =
var _min = minx(Table,Table[Cenario])
var _max = maxx(Table,Table[Cenario])
return
calculate(Table[Value],filter(allselected(Table),Table[Cenario]=_min))- calculate(Table[Value],filter(allselected(Table),Table[Cenario]=_max))
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
82 | |
70 | |
60 |
User | Count |
---|---|
149 | |
114 | |
107 | |
89 | |
67 |