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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.