Forum Discussion
mikayla
5 years agoFrequent Visitor
Dynamic Pre/Post Calculation
I'm trying to dynamically calculate for pre/post sales based on an index slicer selection. My dataset looks as follows: Index Timing TY Sales LY Sales -4 Pre 473891 263538 -3 Pre ...
- 5 years ago
Hi mikayla ,
You could create a measure by the following formula:value = VAR _presum = SUMX ( FILTER ( 'Table', [Timing] = "Pre" ), [TY Sales] ) RETURN DIVIDE ( SUMX ( FILTER ( 'Table', [Timing] = "Post" ), [TY Sales] ) - _presum, _presum )The final output is shown below: When the choice of slicer is different(Use Ctrl to select multiple options), the value is also different
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-yalanwu-msft
Community Support
5 years agoHi mikayla ,
You could create a measure by the following formula:
value =
VAR _presum =
SUMX ( FILTER ( 'Table', [Timing] = "Pre" ), [TY Sales] )
RETURN
DIVIDE (
SUMX ( FILTER ( 'Table', [Timing] = "Post" ), [TY Sales] ) - _presum,
_presum
)
The final output is shown below: When the choice of slicer is different(Use Ctrl to select multiple options), the value is also different
Best Regards,
Yalan Wu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.