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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
AmitSaini
Regular Visitor

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?

 

 

2 REPLIES 2
FreemanZ
Super User
Super User

hi @AmitSaini ,

 

try like:

...

VAR pvevious= 

CALCULATE(

SUM(Status[Automated],

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

)

...

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.

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.

Top Solution Authors