Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

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

IncidentNumberStatus_OldStatus
239222ResolvedClosed
384783ResolvedActive
344522ResolvedActive
343488ActiveResolved

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

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

     



  • Hi,

    Write this measure

    Measure = countrows(filter(values(Data[IncidentNumber]),Data[Status_old]="Resolved"&&Data[Status]="Active"))

    Hope this helps.