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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Show 0 for empty cells in table

I am wondering if there is something similar to excel/pivot table"For empty cells show" (see picture below) in Power BI table/matrix visuals?

I know that is it possible to solve using DAX (replacing empty with 0 in the measure calculation) but I have a lot of measures that would need to be changed in that case

 

joakimfe_0-1625138805721.png

 

2 ACCEPTED SOLUTIONS
Greg_Deckler
Super User
Super User

@Anonymous No, you would have to solve that in DAX. There is a "Show values with no data" but that just shows blanks if that is what the measure returns.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Adjust the corresponding measures, which have null values that you want to transform to 0:

 

newmeasure= var beforemeasure=(here is the measure you used before)
return if(beforemeasure=blank(),0,beforemeasure)

 

 

Wish it is helpful for you!

Best Regards

Lucien

View solution in original post

3 REPLIES 3
v-luwang-msft
Community Support
Community Support

Hi @Anonymous ,

Adjust the corresponding measures, which have null values that you want to transform to 0:

 

newmeasure= var beforemeasure=(here is the measure you used before)
return if(beforemeasure=blank(),0,beforemeasure)

 

 

Wish it is helpful for you!

Best Regards

Lucien

Greg_Deckler
Super User
Super User

@Anonymous No, you would have to solve that in DAX. There is a "Show values with no data" but that just shows blanks if that is what the measure returns.


@ 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!:
The Definitive Guide to Power Query (M)

DAX is easy, CALCULATE makes DAX hard...

Could use mwhite space

ivangarcialeon_0-1677238201370.jpeg

Then create a measure with the function

SELECTEDVALUE, this function returns the value if the columnName context has been filtered to a single different value. Otherwise, it returns alternateResult. (in this case we will assign a 0 to the alternative value)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.