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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

Count of transactions with more than one resolved status

I want to count the total transactions  which have more than one “resolved” status. Each transaction is associated with an unique ID.

The following is an example of data:

 

 

Idstatusdate
1open01/02/2001
1resolved02/06/2001
2open03/03/2001
2resolved04/02/2001
2reslolved05/02/2001
3open01/02/2001
3resolved07/02/2001
3resolved09/02/2001
3resolved09/12/2001

 

The result should be two transaction with more than one resolved status

1 ACCEPTED SOLUTION
jdbuchanan71
Super User
Super User

Hello @Anonymous 

Give this a try, it gives me your expected result.

Measure =
COUNTROWS (
    FILTER (
        VALUES ( YourTable[Id] ),
        CALCULATE (
            COUNTROWS ( YourTable ),
            KEEPFILTERS ( YourTable[status] = "Resolved" )
        ) > 1
    )
)

 

If this solves your issues please mark it as the solution. Kudos 👍 are nice too.

View solution in original post

4 REPLIES 4
v-frfei-msft
Community Support
Community Support

Hi @Anonymous ,

 

To create a measure as below.

 

Measure = 
VAR k =
    FILTER ( 'Table', 'Table'[status] = "resolved" )
VAR a =
    FILTER (
        DISTINCT ( 'Table'[Id] ),
        CALCULATE ( COUNTROWS ( 'Table' ), KEEPFILTERS ( k ) ) > 1
    )
RETURN
    COUNTROWS ( a )

Capture.PNG

 

For more details, please check the pbix as attached.

 

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.
Anonymous
Not applicable

calculate(count('Table'[status]), FILTER('Table','Table'[Id]=EARLIER('Table'[Id])), FILTER('Table','Table'[status]=EARLIER('Table'[status])))
 
 
I put your data into PowerBi (and made sure that 'resolved' was spelled correctly!!) and the above formula worked.
 
Thanks
 
Water
jdbuchanan71
Super User
Super User

Hello @Anonymous 

Give this a try, it gives me your expected result.

Measure =
COUNTROWS (
    FILTER (
        VALUES ( YourTable[Id] ),
        CALCULATE (
            COUNTROWS ( YourTable ),
            KEEPFILTERS ( YourTable[status] = "Resolved" )
        ) > 1
    )
)

 

If this solves your issues please mark it as the solution. Kudos 👍 are nice too.

mgreez
Advocate II
Advocate II

MeasureName=
 
VAR OriginalTable = CALCULATETABLE ( TableName )
 
VAR NewColumnConCat= ADDCOLUMNS ( OriginalTable , "ConCat" , CONCATENATE(TableName[id],TableName[Status]))
 
VAR IDStatusCount = CALCULATE ( COUNTROWS([ConCat] , CONTAINSSTRING (status, "resolved") = TRUE))
 
RETURN = CALCULATE ( IDStatusCount , ">1" )

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors