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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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