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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
SureshPantra
Helper II
Helper II

Comparing Bewteen lastmonth and lastyear same month data

Hi,

Am trying to create a column for the data which is shown below,

 

Column1JunJulAugSepOctNovDecJanFebMarAprMay
A 2525252525252525252525
B232323232323232323232323
C222222222222222222222224
D 23       232323
E2323232323232323232323 
F 25 252525252525252525
G232323232323232323232323
H696969696969696969696934
j 11.511.511.511.511.511.511.511.511.511.511.5

 

Need to compare and create a column, if jun or may we dont have data it has to show "N/A" and if data is there it has to comapre and return increase or decrease.

 

Expecting output as below.

 

Column1JunJulAugSepOctNovDecJanFebMarAprMayStatus
A 2525252525252525252525N/A
B232323232323232323232323No Change
C222222222222222222222224Increase
D 23       232323N/A
E2323232323232323232323 N/A
F 25 252525252525252525N/A
G232323232323232323232323No Change
H696969696969696969696934Decrease
j 11.511.511.511.511.511.511.511.511.511.511.5N/A

 

Thanks in Advance.

 

Regards,

Suresh.

1 ACCEPTED SOLUTION
TeigeGao
Solution Sage
Solution Sage

Hi @SureshPantra ,

Status =
IF (
    Table1[Jun] = BLANK ()
        || Table1[May] = BLANK (),
    "N/A",
    IF (
        Table1[Jun] = Table1[May],
        "No Change",
        IF (
            Table1[Jun] < Table1[May],
            "Increase",
            IF ( Table1[Jun] > Table1[May], "Decrease" )
        )
    )
)

The result will like below: 

PBIDesktop_iPQPtXT1RA.png

Best Regards,

Teige

View solution in original post

1 REPLY 1
TeigeGao
Solution Sage
Solution Sage

Hi @SureshPantra ,

Status =
IF (
    Table1[Jun] = BLANK ()
        || Table1[May] = BLANK (),
    "N/A",
    IF (
        Table1[Jun] = Table1[May],
        "No Change",
        IF (
            Table1[Jun] < Table1[May],
            "Increase",
            IF ( Table1[Jun] > Table1[May], "Decrease" )
        )
    )
)

The result will like below: 

PBIDesktop_iPQPtXT1RA.png

Best Regards,

Teige

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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