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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
ovonel
Post Prodigy
Post Prodigy

Avoiding seeing blank in a card?

I have the next measure in a cube in SSAS:

 

CALCULATE (

DISTINCTCOUNT(‘FactTable’ [Ticket Number]),

 FILTER(‘FactTable’, ‘FactTable’[Amount]>0)

)

 

 

But, when I use it in Power BI for a card, I see blank when the measure is 0.

 

Why is it displaying blank?? How can I make it display 0.

1 ACCEPTED SOLUTION
jppv20
Solution Sage
Solution Sage

Hi @ovonel 

 

Ty adding +0 at the end of the formula:

CALCULATE (

DISTINCTCOUNT(‘FactTable’ [Ticket Number]),

 FILTER(‘FactTable’, ‘FactTable’[Amount]>0)

) +0

 

Jori

 

If I answered your question, please mark it as a solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
Samarth_18
Community Champion
Community Champion

Hi @ovonel 

 

You can try below code:-

measure =
VAR result =
    CALCULATE (
        DISTINCTCOUNT ( 'FactTable'[Ticket Number] ),
        FILTER ( 'FactTable', 'FactTable'[Amount] > 0 )
    )
RETURN
    IF ( result = BLANK (), 0, result )

 

Thanks,

Samarth

 

Best Regards,
Samarth

If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin

@Samarth_18  I like this option better than using +0 as it allows the user to further expand on the measure if needed. +0 works fine but it doesn't have the "agility" of using "If ( result = BLANK ()" or " IF ( ISBLANK (result) , 0...".  Well done on this response.

If I have posted a response that resolves your question, please accept it as a solution to formally close the post.

Also, if you are as passionate about Power BI, DAX and data as I am, please feel free to reach out if you have any questions, queries, or if you simply want to connect and talk to another data geek!

Want to connect?www.linkedin.com/in/theoconias

jppv20
Solution Sage
Solution Sage

Hi @ovonel 

 

Ty adding +0 at the end of the formula:

CALCULATE (

DISTINCTCOUNT(‘FactTable’ [Ticket Number]),

 FILTER(‘FactTable’, ‘FactTable’[Amount]>0)

) +0

 

Jori

 

If I answered your question, please mark it as a solution to help other members find it more quickly.

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.