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
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 ACCEPTED SOLUTIONS
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!

View solution in original post

mdaatifraza5556
Super User
Super User

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.

View solution in original post

5 REPLIES 5
v-pagayam-msft
Community Support
Community Support

Hi @ssk_1984 ,
Can you please confirm whether you have resolved issue. If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.

v-pagayam-msft
Community Support
Community Support

Hi @ssk_1984 ,

I wanted to follow up to see if you had a chance to review the previous response provided by @mdaatifraza5556 and @mark_endicott . I hope it was helpful. If yes, please Accept the answer so that it will be helpful to others to find it quickly.

Thank you.

v-pagayam-msft
Community Support
Community Support

Hi @ssk_1984 ,
Thank you for the helpful response @mdaatifraza5556 and @mark_endicott !
I wanted to check in on your situation regarding new column measure to map text values from previous month within same table. Have you resolved it? If you have, please consider marking the reply that helped you or sharing your solution. It would be greatly appreciated by others in the community who may have the same question.
Thank you.

mdaatifraza5556
Super User
Super User

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

Top Solution Authors