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
kapil512
Helper II
Helper II

How to replace the same value based on the two columns

HI,

 

Can anyone please help me out the below issue?

 

I have the data like below, and i want to replace the second column data using the first column.

 

Column1Column2Replace the value in Column2
191622-082III 
191622-082 III
191622-094III 
191622-094 III
191622-117IV 
191622-117 IV
   
191622-120III 
191622-120 III
191622-121III 

 

I have the data for Column1 and Column2, if column1 has same values but column2 has only one value for those same column1 values.

 

Column3 is the data which we need to replace in column2 blank values(Just for reference i added)

 

i want to replace same Column2 values for all the same column1 values.

 

Thanks,

kapil

1 ACCEPTED SOLUTION
v-sihou-msft
Employee
Employee

@kapil512

 

Just create a calculated column like below;

 

Column =
IF (
    Table3[Column2] = BLANK (),
    CALCULATE (
        MAX ( Table3[Column2] ),
        FILTER (
            Table3,
            Table3[Column1] = EARLIER ( Table3[Column1] )
                && Table3[Column2] <> BLANK ()
        )
    ),
    BLANK ()
)

777.PNG

 

Regards,

View solution in original post

3 REPLIES 3
v-sihou-msft
Employee
Employee

@kapil512

 

Just create a calculated column like below;

 

Column =
IF (
    Table3[Column2] = BLANK (),
    CALCULATE (
        MAX ( Table3[Column2] ),
        FILTER (
            Table3,
            Table3[Column1] = EARLIER ( Table3[Column1] )
                && Table3[Column2] <> BLANK ()
        )
    ),
    BLANK ()
)

777.PNG

 

Regards,

HI Simon,

 

Thank you so much your repose..!

 

Its working fine, Now i am seeing if value is there is Column2 that value i am seeing NULL in column3, but that is not requirment

 

Even Column2 value also displayed in Column3.

 

 

Phase = IF(LaunchPadData[Study Phase] = BLANK(),CALCULATE(MAX(LaunchPadData[Study Phase]),FILTER(LaunchPadData,LaunchPadData[Study Number] = EARLIER(LaunchPadData[Study Number]) && [Study Phase] <> BLANK())),BLANK())

 

Looks i gave the requirment wrongly.

 

sorry for that.

 

Please help me out.

 

Thanks,

Kapil

 

 

Thank you Simon,

 

I got the solution.

 

Thanks,

kapil

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.