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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Anonymous
Not applicable

Replace 0 with Blank()

Hello all, (simple request)

 

While everyone has the issue of 'How to replace Blank() with 0' I'm actually trying to do the opposite.

Instead, I would like to 'Replace 0 with Blank()' aka a Blank space value result. (_____)

 

Below I just want 0 to be a Blank space value

NoNameJake_0-1630711387491.png

What DAX direction would you recommend for this?

Thanks for any feedback and for pointing me in the right direction!

5 REPLIES 5
gidion
New Member

Right click on the column in power query and use the replace values option. Replace '0' with 'null'

gidion_0-1728439172935.png

 

henkvankester
Helper I
Helper I

Maybe use a measure instead of a column: 

 

Name measure = IF(SELECTEDVALUE([min THC%] = 0, BLANK(), SELECTEDVALUE([min THC%])).

 

If min THC% should be summed, then use SUM instead of 'SELECTEDVALUE'. 

 

There is also an option to transform your data, but then you're not using DAX. Change column to text and replace 0 with "" and change back.. 

Tiagojk
New Member

I recomand you use conditional formatting.

0(Zero) would be colored in write.

 

1) Values > Conditional Formatting > Background Color

2) Format Style : Rules

    Rules - If value : = 0  

    then = white color

Tiagojk_1-1669815904058.png

Anonymous
Not applicable

@Greg_Deckler  @Anonymous    I found this post as I am looking for the same thing.    However, I'm not sure the answer above is exactly what the original poster was looking for.   I think he wanted (as do I), an actual empty cell, with no 0 and not a cell that has the word "Blank" in it.   Just an empty cell.    Adding the BLANK() seems to add that word to the cell, rather than just returning an empty cell.   (and I am looking for a measure, not a column).  Any suggestions?

Greg_Deckler
Super User
Super User

@Anonymous Maybe Column = IF([Min THC%] = 0,BLANK(),[Min THC%])



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!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.