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