Forum Discussion
looping using DAX
- 5 years ago
Anonymous this is a simple time intelligence calculation, and as a best practice, it is recommended to add a date dimension to your model to work with dates, and here is one of my post that talk about how to add a date dimension.
Once it is done, just add the following measures, this can be done in one measure too, but I like to break these down for better understanding and also to reuse these measure (if required)
Sum Current = SUM ( Table[Current] ) Sum Prev Day = CALCULATE ( [Sum Current], DATEADD ( 'Calendar'[Date], -1, DAY ) ) Increase = [Sum Current] - [Sum Prev Day]Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
Anonymous this is a simple time intelligence calculation, and as a best practice, it is recommended to add a date dimension to your model to work with dates, and here is one of my post that talk about how to add a date dimension.
Once it is done, just add the following measures, this can be done in one measure too, but I like to break these down for better understanding and also to reuse these measure (if required)
Sum Current = SUM ( Table[Current] )
Sum Prev Day = CALCULATE ( [Sum Current], DATEADD ( 'Calendar'[Date], -1, DAY ) )
Increase = [Sum Current] - [Sum Prev Day]
Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡
I will try this tomorrow and let you know what I got.
Thank you so much for your help.