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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
JoshuaBa
New Member

Clear all values in column

Hi everyone,

 

I have a simple task but I cannot figure out how to do this.

 

I have two columns, one a Retailer column that has dozens of retailers, and a second column that has sales units

I essentially want to clear all values that show under the Sales Units column, but only for the retailer Walmart (all other retailers are unchanged)

I have already filtered the rows to select just Walmart, but I cannot figure out on how to clear the values.

 

I have the following limitations:

 

-I do not want to create a new column

-I cannot use Replace Values as there are thousands of unique values.

 

I looked around and it was advised to use the * symbol in the Replace Values prompt, but it seems it only allows numeric values.

 

Can anyone advise?

 

1 ACCEPTED SOLUTION
AlienSx
Super User
Super User

    replace_walmart = Table.ReplaceValue(
        your_table, 
        null,
        each [Retailer] = "Walmart",
        (v, o, n) => if n then null else v,
        {"Sales Units"}
    )

View solution in original post

4 REPLIES 4
Elcin_7
Frequent Visitor

Hi, 

 

You can create a measure and use the Dax formula below. You need to change the formula with the name of your relevant table and column.

replace = SUMX(tablename, IF(tablename[retailler] = "Walmart", 0, tablename[unitprice]))
 
There are other options but you need to create a column to do them.
AlienSx
Super User
Super User

    replace_walmart = Table.ReplaceValue(
        your_table, 
        null,
        each [Retailer] = "Walmart",
        (v, o, n) => if n then null else v,
        {"Sales Units"}
    )

Just to confirm - there is no easy UI element for me to do this, and I have to use the editor /M code to accomplish this?

no UI, use Advanced Editor

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors