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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Natasha93
Frequent Visitor

Update DAX to Show (BLANK) as 0% with VAR

Hi there 🙂

 

I have a measurment to show percentage of employees working in office and working from home, but when someone shows as 100% as one, the other measure shows as (blank) In turn, the scatter graph I have doesn't show any data.

 

What could I add to my DAX to show (blank) as 0%?

I have tried IF, but I think the VAR is throwing it off.

 

My DAX:

Snag_f9a405.png

 

My graphs / cards:

Snag_f9f793.png

1 ACCEPTED SOLUTION
selimovd
Super User
Super User

Hey @Natasha93 ,

 

you can just add "+0" and it will always show a zero when the value is blank.

So at the end:

..
RETURN
DIVIDE(...) + 0

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

View solution in original post

2 REPLIES 2
Idrissshatila
Super User
Super User

Hello,

 

Try adding before the return this:

 

var result = Divide(WFH_count, Total_count)

Return

SWITCH ( TRUE (), result = BLANK (), 0, result )
 

If I answered your question, please mark my post as solution, Appreciate your Kudos 👍

 

Follow me on Linkedin

 



Did I answer your question? Mark my post as a solution! Appreciate your Kudos
Follow me on LinkedIn linkedIn
Vote for my Community Mobile App Idea

Proud to be a Super User!




selimovd
Super User
Super User

Hey @Natasha93 ,

 

you can just add "+0" and it will always show a zero when the value is blank.

So at the end:

..
RETURN
DIVIDE(...) + 0

 

If you need any help please let me know.
If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍

Best regards
Denis

Blog: WhatTheFact.bi
Follow me: twitter.com/DenSelimovic

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

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