cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
The_Clam
Frequent Visitor

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 II
Super User II

@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 II
Super User II

@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

Bingo!  Thanks so much.

Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.