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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.