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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Mike35
Frequent Visitor

Issue with DAX divide formula & card showing a true 0% calculation

Hi,

 

I'm having issues with my DAX formula in showing a true 0% when the division formula calculates it. Using a Card (New) so as to be able to show if no data is present and therefore blank, then "No data" is displayed however, when my divide formula below calculates 0%, it shows as "No data" also. However in this instance, I want to be able to show as a 0% result as it demonstrates a 0% score rather than just no data being available.

 

Is there a way I can do this?

 

DAX formula below:

Score = 
DIVIDE(
    CALCULATE(
        COUNTROWS(Data),
        Data[Score] = "FC" || Data[Score] = "CID"
    ),
   CALCULATE(
    COUNTROWS(Data),
    Data[Score] = "FC" || Data[Score] = "CID" || Data[Score] = "NC")
)

 

Thanks

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@Mike35 it basically depends on how you want to handle blanks for numerator and denominator:

 

I added two sample measures: what happens if the numerator or denominator is blank, when it returns 0, and when it returns blank. Also, I updated your measure to showcase what you can do to overcome this. You can tweak it further based on your needs since now you know why you are getting blank.

 

Num Blank = DIVIDE ( BLANK (), 1, 0 )

Den Blank = DIVIDE ( 1, BLANK (), 0 )

Score % = 
DIVIDE(
    COALESCE ( 
        CALCULATE(
            COUNTROWS(Data),
            Data[Score] = "FC" || Data[Score] = "CID"
        ),
        0
    ),
   CALCULATE(
    COUNTROWS(Data),
    Data[Score] = "FC" || Data[Score] = "CID" || Data[Score] = "NC")
    
) 

 



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.

View solution in original post

7 REPLIES 7
parry2k
Super User
Super User

@Mike35 it basically depends on how you want to handle blanks for numerator and denominator:

 

I added two sample measures: what happens if the numerator or denominator is blank, when it returns 0, and when it returns blank. Also, I updated your measure to showcase what you can do to overcome this. You can tweak it further based on your needs since now you know why you are getting blank.

 

Num Blank = DIVIDE ( BLANK (), 1, 0 )

Den Blank = DIVIDE ( 1, BLANK (), 0 )

Score % = 
DIVIDE(
    COALESCE ( 
        CALCULATE(
            COUNTROWS(Data),
            Data[Score] = "FC" || Data[Score] = "CID"
        ),
        0
    ),
   CALCULATE(
    COUNTROWS(Data),
    Data[Score] = "FC" || Data[Score] = "CID" || Data[Score] = "NC")
    
) 

 



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.

Thanks @parry2k , appears to work well. Hopefully problem solved.

parry2k
Super User
Super User

@Mike35 Thanks for sharing the sample data. Do you have flat single table that you are working on or do you have other tables in your model? It is important to know the semantic model before I provide a solution.



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.

Ahmedx
Super User
Super User

so what does this show?

Score = 
DIVIDE(
    CALCULATE(
        COUNTROWS(Data),
        Data[Score] = "FC" || Data[Score] = "CID"
    ),
   CALCULATE(
    COUNTROWS(Data),
    Data[Score] = "FC" || Data[Score] = "CID" || Data[Score] = "NC"),
0
)

 

Mike35
Frequent Visitor

Still shows as "No data" as if it is a blank 

parry2k
Super User
Super User

@Mike35 can you share the sample data and explain the issue? It will help to provide the appropriate solution. 



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.

By way of an example, the formula is treating FC & CID results as good results, NC as bad results. Using the formula in my first post, from the below data I'd expect:

 

January: 50.00%

February: 0.00%

March: 100%

April: No data

 

1st JanuaryCID
1st JanuaryNC
1st FebruaryNC
1st MarchFC
1st MarchFC
1st MarchCID

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors