Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

Replace the value Based other column particular market

I have the table name called Global POL. this table have three column . i am trying to replace the packtype value for  particular market  UA04  .this market vakue trying to  set null value value. when i use replace value its changed for the all market 

 

Market              packtype             

UA04                SOFTPACK

UA04                REMARK 

CA04                SOFTPACK

CA04                REMARK

MA04               SOFTPACK

MA04               REMARK

 

Expected Output:

UA04                

UA04                 

CA04                SOFTPACK

CA04                REMARK

MA04               SOFTPACK

MA04               REMARK

 

Looking for support . thanks in advance . 

2 Replies

  • hi Anonymous 

    try to create a calculated column like this:

    column = IF([Market]<>"UA01", [packtype])

  • jaweher899's avatar
    jaweher899
    Impactful Individual

    One way to achieve this in Power BI is to use the FILTER and IF functions together in a calculated column. You can create a new calculated column called "Packtype_Filtered" and use the following formula:

    =IF(Global_POL[Market] = "UA04", BLANK(), Global_POL[Packtype])

    This formula checks if the value in the "Market" column is "UA04", and if so, it returns a blank value. If not, it returns the original value from the "Packtype" column.

    Alternatively, you can also use the SWITCH function to check for different market values and replace the packtype value accordingly:

    =SWITCH(Global_POL[Market], "UA04", BLANK(), Global_POL[Packtype])

    This function checks the market value, and replaces the packtype value based on the market value.