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
bimagty
Frequent Visitor

Previous Month goes blank on some Month

Hello,

 

I have problem with previous month dax. I want to show last month sales revenue based on the slicer, but when I select year of 2022 and month in February, this 'last month' card should display the sum of revenue in January but it shows ((blank)).

 

I tried to change the year to 2021 and it worked fine.

Below the captures:

 

bimagty_0-1645963273500.png

 

I already have 2 tables, 1 table is for data and another 1 for calendar, below are my codes:

last month = CALCULATE (
    SUM('190222'[daily_revenue]),
    PREVIOUSMONTH ( 'Calendar'[Date].[Date] ) )

 

And this is the table relationship:

bimagty_1-1645963400736.png

 

 This is the result when I tried to change the year to 2021:

bimagty_2-1645963451952.png

 

Please help if there is something that I skipped to make it error. Thanks in advance!

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@bimagty Well, make sure you have a separate date table and that it is marked as a date table. Also, you don't need the .[Date] portion. Alternatively, just say no to DAX time "intelligence" functions.

 

You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@bimagty Well, make sure you have a separate date table and that it is marked as a date table. Also, you don't need the .[Date] portion. Alternatively, just say no to DAX time "intelligence" functions.

 

You may find this helpful - https://community.powerbi.com/t5/Community-Blog/To-bleep-With-Time-Intelligence/ba-p/1260000

Also, see if my Time Intelligence the Hard Way provides a different way of accomplishing what you are going for.

https://community.powerbi.com/t5/Quick-Measures-Gallery/Time-Intelligence-quot-The-Hard-Way-quot-TIT...



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Thank you Greg, it is solved.

I marked the table which contains date as date table, and the result is ok now.

 

bimagty_0-1645969013328.png

 

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.