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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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