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
RCM
Regular Visitor

Lookup Record Value from Previous Month

I am trying to understand the most efficient way to look up changes between cell values within an appended query.

 

Background: Each month a new excel file is appended to create a 'Combined' query and I would like to identify when there has been changes to key data fields between months.

 

Example shown below: Blue Columns represent the Appended Query and im looking for a formula that would work to replicate the Orange Columns.

RCM_0-1666091643900.png

Can anyone help! Thanks!

1 ACCEPTED SOLUTION

Hi @RCM ,

It's my pleasure!

You can create another calculated column.

Last month value =
MAXX (
    FILTER (
        'Table',
        'Table'[Record ID] = EARLIER ( 'Table'[Record ID] )
            && MONTH ( 'Table'[Month] )
                = MONTH ( EARLIER ( 'Table'[Month] ) ) - 1
    ),
    'Table'[Value]
)

Result:

vkalyjmsft_0-1666577279359.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

7 REPLIES 7
RCM
Regular Visitor

@amitchandak - Would you have any idea how to resolve this?

RCM
Regular Visitor

@v-yanjiang-msft - Looking for a bit more advice on this!

 

The code provided seems to work however as its based on Months only, in January (01) its not finding December (12) as i think the formula is looking at month number only.

 

Is there any way of expanding this to work for Year as well?

 

Thanks!

v-yanjiang-msft
Community Support
Community Support

Hi @RCM ,

According to your description, here's my soluton, create a calculated column.

Change =
VAR _Pre =
    MAXX (
        FILTER (
            'Table',
            'Table'[Record ID] = EARLIER ( 'Table'[Record ID] )
                && MONTH ( 'Table'[Month] )
                    = MONTH ( EARLIER ( 'Table'[Month] ) ) - 1
        ),
        'Table'[Value]
    )
RETURN
    IF ( _Pre = BLANK (), "N/A", IF ( [Value] = _Pre, "N", "Y" ) )

Get the correct result.

vkalyjmsft_0-1666253456303.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

@v-yanjiang-msft This is excellent,thank you for your help. One last part to solve is how to get last months record value, showing against this months record. Any advice on how i would be able to calculate the last months value column?

RCM_0-1666345514998.png

 

Hi @RCM ,

It's my pleasure!

You can create another calculated column.

Last month value =
MAXX (
    FILTER (
        'Table',
        'Table'[Record ID] = EARLIER ( 'Table'[Record ID] )
            && MONTH ( 'Table'[Month] )
                = MONTH ( EARLIER ( 'Table'[Month] ) ) - 1
    ),
    'Table'[Value]
)

Result:

vkalyjmsft_0-1666577279359.png

I attach my sample below for your reference.

 

Best Regards,
Community Support Team _ kalyj

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

amitchandak
Super User
Super User

@amitchandak Afraid not. The data structure I am okay with. This will involve appending Monthly versions of an Excel. I'm struggling when attempting to lookup what the previous month was against the same ID to understand if a change has been made.

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.