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
Lijun_
New Member

Previousmonth syntax not working

Hello Guys, I am new to Power BI and run into this problem where the PREVIOUSMONTH sytax returns blank value.

I have two tables: Sales Fact and Date Table. I've built the relationshion between these two tables by Date.

My formula looks like:

Sales PM =
CALCULATE(
SUM(‘Sales Fact'[Sales Amount]),
PREVIOUSMONTH('DATE'[Date])
)

 

If you have any clues about what I did wrong, Please help me out. Thanks!!

4 REPLIES 4
v-weiyan1-msft
Community Support
Community Support

Hi  @Lijun_ , 

 

According to your description and the dax formula you provided, here is the test I did with my own sample, and there was no problem.
Since I don’t know the specific situation of your data, in order to help you better locate and solve these problems, I will attach my .pbix file to you. Please try to open it after you receive the file, and compare it with your data and file, to see if you can find any differences.

 

My Sample:

vweiyan1msft_1-1702640009807.png

Result is as below.

vweiyan1msft_0-1702639933287.png

 

Best Regards,

Yulia Yan

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

lukiz84
Memorable Member
Memorable Member

Can you show a diagram of those 2 tables and their relationship? (Sales Fact and Date) - and maybe a screenshot of the matrix?

lukiz84
Memorable Member
Memorable Member

Did you mark the "Date table" as a Date table? 🙂

Hi thank you for replying, I did mark the date table as date table. Forgot to mention, I am need to show sales by month-year

Helpful resources

Announcements
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.

June 2025 community update carousel

Fabric Community Update - June 2025

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