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

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

 
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
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.