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

replace blank with 0 in Matrix

Hi,

I am new to PowerBI and having an issue displaying 0 instead of blank.

 

I have a matrix,

colum: Month (select from Date Hierarchy)

row: Area

values: Measure (Calculate(DISTINCTCOUNT.....)

 

However, I need to replace the blank cells with '0'and the month should be short name. (MMM)

I can only accomplish one of my requirement. That said, I can display 0 (by adding +0  at the end of my measure) with the Month column from date hirerarchy; but when I swith to short month column (creating by Format function), the 0 become blank.

 

I have tried a lot of tricks I could find in the threads. Still, I cannot make both requirements at the same time.

 

Please kindly suggest what can I do.

 

schou12_1-1609822142024.png

 

1 ACCEPTED SOLUTION

Hi, @Anonymous 

 

It’s my pleasure to answer for you.

According to your description, I think the 'add 0' method is fine, I also tried it. But if it isn't used on a  date table, your problem will occur. You can create a date table, set a relationship between them, and use your formula:short_mon = FORMAT(Table [Date], "mmm").

Table =
CALENDAR ( MIN ( TABLE[DateCompleted] ), MAX ( TABLE[DateCompleted] ) )

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

View solution in original post

5 REPLIES 5
parry2k
Super User
Super User

@Anonymous not sure what you mean by short month and it doesn't work, that is probably some other issue. What is short month? Is it from the calendar/date table? Provide bit more details on it.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi,

It's a new column I created to fulfill the MMM format month requirement.

Here's the formula:

short_mon = FORMAT( [DateCompleted], "mmm")

Hi, @Anonymous 

 

It’s my pleasure to answer for you.

According to your description, I think the 'add 0' method is fine, I also tried it. But if it isn't used on a  date table, your problem will occur. You can create a date table, set a relationship between them, and use your formula:short_mon = FORMAT(Table [Date], "mmm").

Table =
CALENDAR ( MIN ( TABLE[DateCompleted] ), MAX ( TABLE[DateCompleted] ) )

If it doesn’t solve your problem, please feel free to ask me.

 

Best Regards

Janey Guo

 

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

parry2k
Super User
Super User

@Anonymous what measure you are using, add 0 to it

 

for example

 

Measure = DISTINCTCOUNT ( Table[Column] ) + 0

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Anonymous
Not applicable

Hi,

Thanks for sharing. 

Actually, I have tried this and it worked if I use the Month column from date hierarchy. But when I switch to month short name column, it doesn't work. 

I have also tried IF(ISBLANK....) and some other methods. None of those can solve both situations.  

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.