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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
PeterNowak
Frequent Visitor

Formula is not working. Month -1, Month -2 etc.

Hello,

 

I prepared a dashboard in PowerBI desktop which is live connect to SQL server.

I used below formula to get data for previous month, month -2 etc, but after the year changed it looks like it's not working.

Could you guys help me how should I prepare the formula to show the data from previous months?

Right now it looks like that:

 

"Requested Date Time'[Requested Date (Month Number)]= MONTH(TODAY())-1"
1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @PeterNowak 

Try

 MONTH ( EDATE( TODAY( ), -1) )

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Cheers 

 

SU18_powerbi_badge

View solution in original post

2 REPLIES 2
AlB
Community Champion
Community Champion

Hi @PeterNowak 

Try

 MONTH ( EDATE( TODAY( ), -1) )

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Cheers 

 

SU18_powerbi_badge

amitchandak
Super User
Super User

@PeterNowak . If you have a date you can use the date table and time intelligence

 

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

 

Power BI — Month on Month with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-mtd-questions-time-intelligence-3-5-64b0b4a4090e
https://www.youtube.com/watch?v=6LUBbvcxtKA

 

Also check Why Time Intelligence fails - https://www.youtube.com/watch?v=OBf0rjpp5Hw

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

Feb2025 NL Carousel

Fabric Community Update - February 2025

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