Forum Discussion
Running Total lastyear
Hi,
I recommend creating a normal RT calculation like:
RT =CALCULATE (SUM (Dados[Mês])ALLSELECTED ( Dados), Dados[Data Valor] <= MAX(CALENDARIO[Date]))
Then create LY measure like this:
[RT LY] =
CALCULATE([RT],SAMEPERIODLASTYEAR(CALENDARIO[Date]))
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/hi ValtteriN
keeps returning blank
Sorry about that, Here is a revised version:
RT =
var maxdate = MAX(CALENDARIO[Date]) returnCALCULATE (SUM (Dados[Mês])ALL( CALENDARIO), CALENDARIO[Date] <= maxdate)
Also for future reference check this article by SQLBI about the topic: https://www.sqlbi.com/articles/computing-running-totals-in-dax/Hi Paulo123 ,
Sorry, It's hard to give an accurate formula without detail information. SAMEPERIODLASTYEAR works well in my model. Please refer to this pbix
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 Replies
- ValtteriNCommunity Champion
Hi,
I recommend creating a normal RT calculation like:
RT =CALCULATE (SUM (Dados[Mês])ALLSELECTED ( Dados), Dados[Data Valor] <= MAX(CALENDARIO[Date]))
Then create LY measure like this:
[RT LY] =
CALCULATE([RT],SAMEPERIODLASTYEAR(CALENDARIO[Date]))
I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!
My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/ - ValtteriNCommunity Champion
Sorry about that, Here is a revised version:
RT =
var maxdate = MAX(CALENDARIO[Date]) returnCALCULATE (SUM (Dados[Mês])ALL( CALENDARIO), CALENDARIO[Date] <= maxdate)
Also for future reference check this article by SQLBI about the topic: https://www.sqlbi.com/articles/computing-running-totals-in-dax/
- V-lianl-msftCommunity Support
Hi Paulo123 ,
Sorry, It's hard to give an accurate formula without detail information. SAMEPERIODLASTYEAR works well in my model. Please refer to this pbix
Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.