Forum Discussion
Jamie1989
4 years agoRegular Visitor
YTD Sales Variance
Hello all! New user to Power BI and currently working my way through learning! I am stuck at waterfalls at the moment. I am following allow with this guide Create scatter, waterfall, and funn...
v-chenwuz-msft
4 years agoCommunity Support
Hi Jamie1989 ,
I think it's showing you how he created the waterfall chart. You are probably more concerned that you only have the green increase in your results and not the red decrease are you?
Actually, as long as the number given (the number entered into the chart, the value you put in Values) has a negative number, there will be a red drop.
As for the YTD sales variation, it means the total sales of the year minus the total sales of the previous year. So I wrote the following DAX for your reference.
YTD Sales Variance =
VAR _varp =
CALCULATE(
SUM( 'Sale'[revenue] ),
FILTER( ALL( 'Date' ), [year] = SELECTEDVALUE( 'Date'[year] ) - 1 )
)
VAR _varc =
SUM( Sale[revenue] )
RETURN
_varc - _varp
Result:
pbix at the end.
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.