Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
To calc the variance between current vs previous month amounts, I use this formula:
AdsPromo Var = if([AdsPromo LM] = BLANK(), 0,
[AdsPromo]-[AdsPromo LM])
For Feb17, the AdsPromo Var amount is still 0 using the above formula when it should be 464 (464-0). Kindly advise on how resolve the error in the measure/DAX.
Tks: -Nik
Solved! Go to Solution.
Hi @Anonymous ,
Assuming that your source table is similar to below -
If you are looking for a measure, use below DAX query -
AdsPromo Var =
VAR current_Month =
CALCULATE ( SUM ( 'Table'[AdsPromo] ) )
VAR previous_Month =
CALCULATE ( SUM ( 'Table'[AdsPromo] ), PREVIOUSMONTH ( 'Table'[Month-S] ) )
VAR AdsPromoVariance = current_Month - previous_Month
RETURN
AdsPromoVariance
The Month-S column should be the date type.
Here is the output
Regards,
Nandu Krishna
Thanks, @nandukrishnavs .
All is good.
In fact, I have also managed to create the variance percentage subsequently.
KRgds: -Nik
Hi @Anonymous ,
Assuming that your source table is similar to below -
If you are looking for a measure, use below DAX query -
AdsPromo Var =
VAR current_Month =
CALCULATE ( SUM ( 'Table'[AdsPromo] ) )
VAR previous_Month =
CALCULATE ( SUM ( 'Table'[AdsPromo] ), PREVIOUSMONTH ( 'Table'[Month-S] ) )
VAR AdsPromoVariance = current_Month - previous_Month
RETURN
AdsPromoVariance
The Month-S column should be the date type.
Here is the output
Regards,
Nandu Krishna
Thanks, @nandukrishnavs .
All is good.
In fact, I have also managed to create the variance percentage subsequently.
KRgds: -Nik
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
117 | |
101 | |
71 | |
61 |