Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Previousmonth Month and Row Context

Hey Community, i have a question regarding time intelligence and row context. 

 

I want to build a monthly growth measure using the following formulas: 

 

- [Bestand] --> (Its a Running total, but thats not really relevant)

- [Bestand Vormonat] =CALCULATE([Bestand],PREVIOUSMONTH(Datum[Datum]))

Bestand - Bestandswachstum (Laufend) = [Bestand]-[Bestand Vormonat]

 

This should give me the monthly growth of [Bestand]. 

This works out just fine, if i use a matrix or table with MONTHS as rows and therefore having a filter context on month. 

 

Problem (or not so much because it works as intended, but: 

- If i use YEARS as the row context for a matrix or table, the monthly growth switches to a YOY calculation. 

 

See the attached jpg.

 

Previousmonth.JPG

From my point of view, this behaviour seems to be somehow inutitiv and delivers the expected result, however im not so sure, how this works, bevause Previousmonth should result in 1 Month shift backwards....

 

Thx for your help

 

 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Anonymous , Previousmonth take start date , so try using datesmtd

last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

Please refer my video where I explained this diff

https://www.youtube.com/watch?v=1KkoJehRVeg

 

There 2 video before this that explain TI in details

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@Anonymous , Previousmonth take start date , so try using datesmtd

last MTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESMTD(dateadd('Date'[Date],-1,MONTH)))

 

Please refer my video where I explained this diff

https://www.youtube.com/watch?v=1KkoJehRVeg

 

There 2 video before this that explain TI in details

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors