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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AmitSaini
Helper I
Helper I

How to get previous month values based on Month year column values

Hi Community member,

Need help to get some desired result.

Below is the my dataset.

AmitSaini_6-1733133719631.png

 

and I already create a measure to calcualte the values for previous months for column automated. below is the measure:

AmitSaini_2-1733133321519.png

and my table look like below and that is absoluty fine:

AmitSaini_7-1733133838475.png

 

But i want to show previous month data  based on MonthName column [column name shown on first screenshot]  and when i use monthname column on table then previous month data is showing 0. see below pic.

AmitSaini_8-1733133963433.png

Please suggest. how can i use monthname column to calculate previous months data based on projectname?

 

 

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

Create a date table and mark it as a date table. There's lots of articles and videos on how to do that. Link your date table to the date column in your fact table, and then use columns from your date table in the visuals. Your measure using PREVIOUSMONTH will then work if you change the date column to the date column from the date table.

View solution in original post

4 REPLIES 4
FreemanZ
Super User
Super User

hi @AmitSaini ,

 

try like:

...

VAR pvevious= 

CALCULATE(

SUM(Status[Automated],

EOMONTH(Status[datevalue], 0) = EOMONTH(MAX(Status[datevalue]), -1)

)

...

Hi FreemanZ,

 

Thanks for you reply.

I tried your suggestion but it won't works when we use monthname column.

johnt75
Super User
Super User

Create a date table and mark it as a date table. There's lots of articles and videos on how to do that. Link your date table to the date column in your fact table, and then use columns from your date table in the visuals. Your measure using PREVIOUSMONTH will then work if you change the date column to the date column from the date table.

Hi  johnt75,

 

Thanks for the suggestion and it works very well. Really appreciate it.

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.