cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
vnqt
Helper IV
Helper IV

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
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

Check out the November 2023 Power BI update to learn about new features.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors