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
The_Clam
Helper I
Helper I

Need help with blanks and zeros - calculation percentages by category

Hi.  I am have having trouble displaying blanks AND zeros in my Power BI percentage matix.  I seem to be able to display one or the other, but I need both.  I have 3 tables: Ticket Data, Severity, and Date (with relationships).  Tickets that have no data, I need to remain blank.  Ticket calculations that divide into zero, need to show zero.  See expected result below.  Thanks!

 

Expected Result:

SeverityJanuaryFebruary

Critical

 

0.00%

High 100%
Moderate 40%
Low  
1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

@The_Clam try it like this.

 

Measure =
VAR _Under4 = COUNTROWS ( FILTER ( 'Ticket Data', 'Ticket Data'[Time to Resolve (hours)] < 4 ) )
VAR _Tickets = COUNTROWS ( 'Ticket Data' )
RETURN
    IF (
        ISBLANK ( _Tickets ),
        BLANK (),
        IF ( ISBLANK ( _Under4 ), 0, DIVIDE ( _Under4, _Tickets, 0 ) )
    )

jdbuchanan71_0-1614797624411.png

 

 

View solution in original post

2 REPLIES 2
jdbuchanan71
Super User
Super User

@The_Clam try it like this.

 

Measure =
VAR _Under4 = COUNTROWS ( FILTER ( 'Ticket Data', 'Ticket Data'[Time to Resolve (hours)] < 4 ) )
VAR _Tickets = COUNTROWS ( 'Ticket Data' )
RETURN
    IF (
        ISBLANK ( _Tickets ),
        BLANK (),
        IF ( ISBLANK ( _Under4 ), 0, DIVIDE ( _Under4, _Tickets, 0 ) )
    )

jdbuchanan71_0-1614797624411.png

 

 

Bingo!  Thanks so much.

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.