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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends September 15. Request your voucher.

Reply
sagar512
Helper I
Helper I

Replace values to null in matrix table

I want to replace Unknowns with null without duplicating the columns in the matrix table

is there any way to achieve that?

 

sagar512_0-1666098326423.png

 

4 REPLIES 4
v-xiaotang
Community Support
Community Support

Hi @sagar512 

Thanks for reaching out to us.

please try this, go to Power Query Editor, and select all columns then select replace values,

vxiaotang_0-1667373346747.png

result

vxiaotang_1-1667373389978.png

FYI: 

let
    Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("i45WCg70UdIBk7E6MF5oXnZefnkeWATGRlcD5sUCAA==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [Column1 = _t, Column2 = _t]),
    #"Changed Type" = Table.TransformColumnTypes(Source,{{"Column1", type text}, {"Column2", type text}}),
    #"Replaced Value" = Table.ReplaceValue(#"Changed Type","Unknown",null,Replacer.ReplaceValue,{"Column1", "Column2"})
in
    #"Replaced Value"

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Thanks for your response.

However, I don't have an option of using a query editor as I am with PowerBI data sets (Direct query).

Hi @sagar512 

Thanks for your reply.

In this scenario, you need to replace unknown values to null in your datasource. Otherwise, PowerBI Desktop cannot modify your original data without adding columns., 

 

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

Greg_Deckler
Community Champion
Community Champion

@sagar512 Sorry, having trouble following, can you post sample data as text and expected output?
Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2.



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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