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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
newpbiuser01
Helper V
Helper V

Flagging Change in Data from Previous Month

Hello,

I have a table that lists the method of payment by a vendor and the month/year the transaction took place. 

VendorMonth-YearMethod
A2-2021Debit Card
A2-2021Credit Card
B3-2021Debit Card
C5-2021Credit Card
D1-2022Credit Card
E2-2022Check
B9-2023Check
C7-2021Credit Card
D11-2022Debit Card
A8-2023Check
B12-2022Credit Card
C7-2023Debit Card
D8-2021Check
B1-2023Debit Card

 

I need to create a report that flags the method change each month by vendor. So for vendor A, first get the different methods used in the same month - so in February 2021 (2-2021), vendor A paid us through debit card and then by credit card once. So for that month, the method would be concatenated to be Credit Card, Debit Card.  

The next step would be to get the method for the previous month (1-2021), and get the method and then flag it they were the same or not. So the result would be:

 

VendorMonth-YearPrevious Month-YearCurrent MethodPrevious MethodFlag
A2-20211-2021Debit Card, Credit Card -
B3-20212-2021Debit CardDebit Card, Credit CardChange
C5-20214-2021Credit Card -
D1-202212-2021Credit Card -
E2-20221-2022CheckCredit CardChange
B9-20238-2023CheckCheckSame
C7-20216-2021Credit Card -
D11-202210-2022Debit Card -
A8-20237-2023CheckDebit CardChange
B12-202211-2022Credit CardDebit CardChange
C7-20236-2023Debit 
D8-20217-2021CheckCredit CardChange
B1-202312-2022Debit CardCredit CardChange

 

I think it has to be done in calculated columns because I need to calculate it for each row and flag each vendor record for each month/year. But, given that we have a large data set, I can't figure out how to do this. Would anyone know how I could do this?

 

Really appreciate any help!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @newpbiuser01 ,

 

I suggest you to convert [Month-Year] column as Date data type column and format it in MM-YYYY. This will make your calculation easier.

Measures:

Previous Month-Year = 
EOMONTH(MAX('Table'[Month-Year]),-2)+1
Current Method = 
CONCATENATEX('Table',[Method],", ")
Previous Method = 
CALCULATE (
    [Current Method],
    FILTER (
        ALL ( 'Table' ),
        'Table'[Month-Year]
            = EOMONTH ( MAX ( 'Table'[Month-Year] ), -2 ) + 1
    )
)
Flag = 
IF (
    [Previous Method] = BLANK (),
    "-",
    IF ( [Current Method] = [Previous Method], "Same", "Change" )
)

Result is as below.

vrzhoumsft_0-1686539515124.png

 

Best Regards,
Rico Zhou

 

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

2 REPLIES 2
Anonymous
Not applicable

Hi @newpbiuser01 ,

 

I suggest you to convert [Month-Year] column as Date data type column and format it in MM-YYYY. This will make your calculation easier.

Measures:

Previous Month-Year = 
EOMONTH(MAX('Table'[Month-Year]),-2)+1
Current Method = 
CONCATENATEX('Table',[Method],", ")
Previous Method = 
CALCULATE (
    [Current Method],
    FILTER (
        ALL ( 'Table' ),
        'Table'[Month-Year]
            = EOMONTH ( MAX ( 'Table'[Month-Year] ), -2 ) + 1
    )
)
Flag = 
IF (
    [Previous Method] = BLANK (),
    "-",
    IF ( [Current Method] = [Previous Method], "Same", "Change" )
)

Result is as below.

vrzhoumsft_0-1686539515124.png

 

Best Regards,
Rico Zhou

 

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

 

Thank you! that works beautifully!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Users online (18,179)