Forum Discussion
Looking for a count when text values in 2 different columns in the same table equal specific values
I'm fairly new to Power BI and self admittedly know enough to be dangerous!
I have a table like the one below that I can create easily in Power BI. However, I would like to create a Card with a count of the rows that contain Status_Old = "Resolved" AND Status = "Active", denoting that a ticket was reopened.
TABLE=Audit_Incident
| IncidentNumber | Status_Old | Status |
| 239222 | Resolved | Closed |
| 384783 | Resolved | Active |
| 344522 | Resolved | Active |
| 343488 | Active | Resolved |
Count = 2
I've been back and forth on Google and through the Power BI DAX expression reference and have found some things that get me close, but still can't seem to nail the exact combination of functions that will produce the correct result, as I think it's going to take a combination of functions/statements to get this?!?
Thanks in advance for your help!
Hello, you can solve it with countrows and filter functions as shown below:
counter = COUNTROWS(FILTER('Table (2)','Table (2)'[Status_Old]="Resolved"&& 'Table (2)'[Status] = "Active"))
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !!
2 Replies
- Ritaf1983
Super User
Hello, you can solve it with countrows and filter functions as shown below:
counter = COUNTROWS(FILTER('Table (2)','Table (2)'[Status_Old]="Resolved"&& 'Table (2)'[Status] = "Active"))
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! - Ashish_Mathur
Super User
Hi,
Write this measure
Measure = countrows(filter(values(Data[IncidentNumber]),Data[Status_old]="Resolved"&&Data[Status]="Active"))
Hope this helps.