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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
gcongrove
Frequent Visitor

Measure to calculate the number of times a text string appears in a column, that also displays 0

Hello,

I am tracking Incident tickets and reporting in their status (Open, Closed, Pending, In Progress, Resolved)

Here is a look at my data.    I want to report on how many INC are Open or closed etc.  But I also want to display 0 if I currently have no count for a particular  INC's.   For instance, if there are no currently open tickets.
Capture.PNG

1 ACCEPTED SOLUTION
speedramps
Community Champion
Community Champion

 
You could use these DAX measures in a card.
The + 0 forces a value to be returned when there is none.
For example Fixed will = 0

Open = CALCULATE(COUNTROWS(Incidents),Incidents[Status]="Open") + 0
Closed = CALCULATE(COUNTROWS(Incidents),Incidents[Status]="Closed") + 0
Fixed = CALCULATE(COUNTROWS(Incidents),Incidents[Status]="Fixed") + 0
Does that answer your question?

View solution in original post

2 REPLIES 2
speedramps
Community Champion
Community Champion

 
You could use these DAX measures in a card.
The + 0 forces a value to be returned when there is none.
For example Fixed will = 0

Open = CALCULATE(COUNTROWS(Incidents),Incidents[Status]="Open") + 0
Closed = CALCULATE(COUNTROWS(Incidents),Incidents[Status]="Closed") + 0
Fixed = CALCULATE(COUNTROWS(Incidents),Incidents[Status]="Fixed") + 0
Does that answer your question?

Exactly what I needed, thank you! This will help me in several other reports as well.

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Feb2025 NL Carousel

Fabric Community Update - February 2025

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