cancel
Showing results 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

Anonymous
Not applicable

## Distinct Count with text column condition

Hi,
How can I count the Distinct number of cases where the count of "Yes"is > 1

 Case no Yes Column 12 12 12 Yes 13 13 Yes 13 Yes

``Count of Cases = CALCULATE(DISTINCTCOUNT('Table'[Case no]),FILTER('Table','Table'[Yes Col] = "Yes"))​``

I can calculate the number of cases but i don't want the cases with only one "Yes". So from the above table it should skip case no 12 and should give answer as 1 i.e caseno 13

Thanks!!

1 ACCEPTED SOLUTION
Super User

Hi,

Please check the below picture and the attached pbix file.

``````expected result measure: =
COUNTROWS (
FILTER (
DISTINCT ( 'Table'[Case no] ),
CALCULATE ( COUNTROWS ( FILTER ( 'Table', 'Table'[Yes Column] = "Yes" ) ) ) > 1
)
)
``````

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

Visit my LinkedIn page by clicking here.

Schedule a meeting with me to discuss further by clicking here.

6 REPLIES 6
Super User

Hello,
Good monrning,
i think above two solutions in one of the solutions useful for you.

Anonymous
Not applicable

Super User

Hi,

Please check the below picture and the attached pbix file.

``````expected result measure: =
COUNTROWS (
FILTER (
DISTINCT ( 'Table'[Case no] ),
CALCULATE ( COUNTROWS ( FILTER ( 'Table', 'Table'[Yes Column] = "Yes" ) ) ) > 1
)
)
``````

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.

Visit my LinkedIn page by clicking here.

Schedule a meeting with me to discuss further by clicking here.

Anonymous
Not applicable

Hi,

Thankyou. This measure works the best.

Regards,

Shubham

Super User

@Anonymous , have these two measures

measure 1= calculate(count('Table'[case no]),FILTER('Table','Table'[Yes Col] = "Yes"))

Measure
count GT 1 = countx(values('Table'[case no]), if([measure 1]>1, [case no], blank()))

Anonymous
Not applicable

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - August 2024

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

#### Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

#### Fabric Community Update - September 2024

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

Top Solution Authors
Top Kudoed Authors