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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
ssk_1984
Helper I
Helper I

New Column measure to map text values from previous month within same table

Help to create new column measure to map values from previous month values based on employee ID from the same table.

Sample 

IDMonthMet StatusCurrent Month-1 Met StatusCurrent Month-2 Met Status
A16/1/2025Met  
A26/1/2025Met  
A35/1/2025Not Met  
A15/1/2025Met  
A24/1/2025Met  
A34/1/2025Met  

 

in the above data, i have map  to 'Current Month-1 Met Status ' based on ID, 

Ex. ID A1, and Month 6/1/2025, Current status, Met, for Current Month-1, it has fetch details from the ID A1 last appeared month, A1 previous month status also, MET. That value to appeared on respective column

IDMonthMet StatusCurrent Month-1 Met StatusCurrent Month-2 Met Status
A16/1/2025MetMetBlank
A26/1/2025MetBlankMet
A35/1/2025Not Met  
A15/1/2025Met  
A24/1/2025Met  
A34/1/2025Met  

 

IDMonthMet StatusCurrent Month-1 Met StatusCurrent Month-2 Met Status
A16/1/2025MetMetBlank
A26/1/2025MetBlankMet
A35/1/2025Not MetMetMet
A15/1/2025MetBlankBlank
A24/1/2025MetBlankBlank
A34/1/2025MetBlankBlank

 

i have tried with  below measure but it is giving me proper values

 

2 REPLIES 2
mdaatifraza5556
Solution Specialist
Solution Specialist

Hi @ssk_1984 

Create calculated column using below dax.

Current Month-1 Met Status =
VAR CurrentID = 'Table'[ID]
VAR CurrentMonth = 'Table'[Month]
VAR PrevMonth = EDATE(CurrentMonth, -1)
RETURN
    CALCULATE (
        MAX ('Table'[Met Status]),
        FILTER (
            'Table',
            'Table'[ID] = CurrentID &&
            'Table'[Month] = PrevMonth
        )
    )


second calculated col 

Current Month-2 Met Status =
VAR CurrentID = 'Table'[ID]
VAR CurrentMonth = 'Table'[Month]
VAR PrevMonth = EDATE(CurrentMonth, -2)
RETURN
    CALCULATE (
        MAX ('Table'[Met Status]),
        FILTER (
            'Table',
            'Table'[ID] = CurrentID &&
            'Table'[Month] = PrevMonth
        )
    )
Screenshot 2025-06-27 160517.png

 

If this answers your questions, kindly accept it as a solution and give kudos.
mark_endicott
Super User
Super User

@ssk_1984 

 

Create a date table with the code below:

 

DateTable = CALENDARAUTO()

You will need to create a relationship between this table and your Month column. 

 

Then create a measure with this code:

 

VAR _id = SELECTEDVALUE( Table[ID] )

RETURN
CALCULATE( SELECTEDVALUE( Table[Met Status] ), DATEADD( DateTable[Date], -1, MONTH ), KEEPFILTERS( Table[ID] = _id ))

 

Just replace Table with your table name. 

 

If I answered your question please mark my post as the solution, it helps others with the same challenge find the answer!

Helpful resources

Announcements
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 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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