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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
vnqt
Helper V
Helper V

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
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

PBI_Carousel_NL_June

Fabric Community Update - June 2024

Get the latest Fabric updates from Build 2024, key Skills Challenge voucher deadlines, top blogs, forum posts, and product ideas.

Top Solution Authors