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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
jtma508
Regular Visitor

Previous Month from January

Not a new issue and shocking that it still hasn't been resolved.  I posted this under issues already but if anyone has a workaround that actually works I would be most grateful.  If you have a PBI report that provides numbers from the Previous Month, none of the functions PREVIOUSMONTH, PARALLELPERIOD, or DATEADD will return values if you happen to be reporting from the month of January.  They all return nothing.  It would seem none have been coded to look back to the previous year when the month=January.  I've searched for workarounds but so far none have functioned as-advertised.  

 

I had been using a Measure:   Sales Prev MO = CALCULATE([Total Sales], PREVIOUSMONTH(Dates[sDate]))  which works fine for every month except January.  So I attempted to trap for January and tried several permutations of:

 

Sales Prev MO = IF(MONTH([LDate])>1,CALCULATE([Total Sales], PREVIOUSMONTH(Dates[sDate])) ,CALCULATE([Total Sales],*** nothing I've tried here works.
 
I've tried PARALLELPERIOD, DATEADD, and a hail Mary combining PREVIOUSYEAR with PREVIOUSMONTH.  
 
Any sugestions?
 
 
1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @jtma508 ,

 

It works fine on my side.

Sales Prev MO = CALCULATE(SUM('Table'[value]), PREVIOUSMONTH('calendar'[date]))

Capture.PNG

My Power BI Desktop version is December 2021. Try upgrading your application and check again.

Or you could try using below formula:

Sales Prev MO = CALCULATE(SUM('Table'[value]), FILTER(ALLSELECTED('Table'),FORMAT('Table'[date],"YYYYMM") = FORMAT(EDATE(SELECTEDVALUE('calendar'[date]),-1),"YYYYMM")))

 

Best Regards,

Jay

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @jtma508 ,

 

It works fine on my side.

Sales Prev MO = CALCULATE(SUM('Table'[value]), PREVIOUSMONTH('calendar'[date]))

Capture.PNG

My Power BI Desktop version is December 2021. Try upgrading your application and check again.

Or you could try using below formula:

Sales Prev MO = CALCULATE(SUM('Table'[value]), FILTER(ALLSELECTED('Table'),FORMAT('Table'[date],"YYYYMM") = FORMAT(EDATE(SELECTEDVALUE('calendar'[date]),-1),"YYYYMM")))

 

Best Regards,

Jay

amitchandak
Super User
Super User

@jtma508 , Please check the suggestion from @AlexisOlson  and also check if your calendar is complete.

1. if the dates are missing in the calendar

2. Do you have timestamp in dates in your fact for Jan. Date join should be on column without timestamp

3. calendar  table si marked as date table 

 

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...

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
AlexisOlson
Super User
Super User

My first guess would be that you might have a year filter context that's combining with PREVIOUSMONTH resulting in nothing.

 

Can you provide a simple example or .pbix that we can test against?

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.