cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
NickPatelMRCG Regular Visitor
Regular Visitor

Edit Single Cell in Power BI

Hello,

 

I am trying to edit the data through Power BI Desktop.  We have a lot of data that needs manually modified, but it seems the replace function does not work on a single cell.  How would someone suggest to manually modify data in Power Bi? All of this data comes from a source that cannot be modified prior to coming into Power BI. (Trying to automate a report)

 

Thank you,

Nick Patel

1 ACCEPTED SOLUTION

Accepted Solutions
v-yulgu-msft Super Contributor
Super Contributor

Re: Edit Single Cell in Power BI

Hi @NickPatelMRCG,

 

If you can specify the single cell with a certain rule, you can replace the value with a IF statement to avoid replacing all data values.

 

In below example, I replace the "PO" in third row where [Name] is Josh.

let
    Source = Excel.Workbook(File.Contents("C:\Users\xxxx\Desktop\Sample Data.xlsx"), null, true),
    data_Sheet = Source{[Item="data",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(data_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Name", type text}, {"Type of Product", type text}, {"Location", type text}, {"Start Date", type date}, {"End Date", type date}, {"Net Rev(USD)", Int64.Type}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","PO", each if [Name]="Josh" then "HH" else "PO" ,Replacer.ReplaceText,{"Type of Product"})

in
    #"Replaced Value"

1.PNG      2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
2 REPLIES 2
Highlighted
ricardocamargos Established Member
Established Member

Re: Edit Single Cell in Power BI

Hi @NickPatelMRCG,

 

You can do it using Power Query.

 

Do you have any ID, so it's possible to replace the content based on it.

 

v-yulgu-msft Super Contributor
Super Contributor

Re: Edit Single Cell in Power BI

Hi @NickPatelMRCG,

 

If you can specify the single cell with a certain rule, you can replace the value with a IF statement to avoid replacing all data values.

 

In below example, I replace the "PO" in third row where [Name] is Josh.

let
    Source = Excel.Workbook(File.Contents("C:\Users\xxxx\Desktop\Sample Data.xlsx"), null, true),
    data_Sheet = Source{[Item="data",Kind="Sheet"]}[Data],
    #"Promoted Headers" = Table.PromoteHeaders(data_Sheet, [PromoteAllScalars=true]),
    #"Changed Type" = Table.TransformColumnTypes(#"Promoted Headers",{{"Name", type text}, {"Type of Product", type text}, {"Location", type text}, {"Start Date", type date}, {"End Date", type date}, {"Net Rev(USD)", Int64.Type}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","PO", each if [Name]="Josh" then "HH" else "PO" ,Replacer.ReplaceText,{"Type of Product"})

in
    #"Replaced Value"

1.PNG      2.PNG

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Virtual Launch Event

Microsoft Business Applications October Virtual Launch Event

Join us for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

PBI Community Highlights

PBI Community Highlights

Check out what's new in the Power BI Community!

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Top Kudoed Authors
Users Online
Currently online: 200 members 1,837 guests
Please welcome our newest community members: