Forum Discussion
Difference between current value and previous value respect to date.
- Anonymous2 years ago
Hi krishna_chitrak ,
Thanks for the reply from Uzi2019 , please allow me to provide another insight:
You need to create a date table and then model the one-to-many relationship. Then create a formula similar to the following to be able to correctly use the date hierarchy as the x-axis.
M_activce = VAR active_ = CALCULATE ( SUM ( 'Table'[Active] ) ) VAR last_month = CALCULATE ( SUM ( 'Table'[Active] ), DATEADD ( 'Date'[Date], -1, MONTH ) ) RETURN active_ - last_monthM_inactivce = VAR inactive_ = CALCULATE ( SUM ( 'Table'[Inactive] ) ) VAR last_month = CALCULATE ( SUM ( 'Table'[Inactive] ), DATEADD ( 'Date'[Date], -1, MONTH ) ) RETURN inactive_ - last_monthBest Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi krishna_chitrak ,
Thanks for the reply from Uzi2019 , please allow me to provide another insight:
You need to create a date table and then model the one-to-many relationship. Then create a formula similar to the following to be able to correctly use the date hierarchy as the x-axis.
M_activce =
VAR active_ =
CALCULATE ( SUM ( 'Table'[Active] ) )
VAR last_month =
CALCULATE ( SUM ( 'Table'[Active] ), DATEADD ( 'Date'[Date], -1, MONTH ) )
RETURN
active_ - last_month
M_inactivce =
VAR inactive_ =
CALCULATE ( SUM ( 'Table'[Inactive] ) )
VAR last_month =
CALCULATE ( SUM ( 'Table'[Inactive] ), DATEADD ( 'Date'[Date], -1, MONTH ) )
RETURN
inactive_ - last_month
Best Regards,
Adamk Kong
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- krishna_chitrak2 years agoRegular Visitor
Hi Adamk Kong,
It's a very helpful solution. Want to ask that is it possible to add buttons and switch to day and month difference?