cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
vnqt
Helper III
Helper III

Count with 2 dependent conditions

Hi

 

I have the following table : 

 

NameSerial numberStatus
name1number1Expired
name1number2Running
name3number3Running
name3number4Expired
name5number5Running
name6number6Preparation
name7number7Running
name8number8Preparation
name9number9Running
name10number10Preparation
name11number11Running
name12number12Expired

I would like to sort out the Serial number, if the Serial numbers have the same name, need to filter by Status "Running"

 

The result would remove the 2 lines below :

 

NameSerial numberStatus
name1number1Expired
name1number2Running
name3number3Running
name3number4Expired
name5number5Running
name6number6Preparation
name7number7Running
name8number8Preparation
name9number9Running
name10number10Preparation
name11number11Running
name12number12Expired

 

Thank you in advance for your help

2 REPLIES 2
krishna0
Helper II
Helper II

Hello!

 

Wouldn't it be enough to just remove "Expired" status? Or you need the additional check? This measure would look like:

CALCULATE ( DISTINCTCOUNT ( 'Table'[Serial number] ), 'Table'[Status] <> "Expired" )

 In case you do not need Distinctcount, you can just replace with a count. Please share some more details, because I might not understand your question fully.

 

BR

This doesn't work in my case, I can't just remove Status Expired. Because I have many cases like name12, it doesn't have a duplcate.

 Result should be 10

 

Helpful resources

Announcements
May 2023 update

Power BI May 2023 Update

Find out more about the May 2023 update.

Submit your Data Story

Data Stories Gallery

Share your Data Story with the Community in the Data Stories Gallery.

Top Solution Authors