cancel
Showing results for
Did you mean:
Helper I

## 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.

6 REPLIES 6
Solution Sage

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

Helper I

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.

Helper I

Hi,

Thankyou. This measure works the best.

Regards,

Shubham

Super User

@ShubhamPandey , 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()))

Learn Power BI - Full Course with Dec-2022, with new DAX functions like Window, Index, Offset !!
Did I answer your question? Mark my post as a solution! Appreciate your Kudos !! Proud to be a Super User! !!
Formatted Profit and Loss Statement with empty lines
Helper I

Announcements

#### 2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

#### Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

#### 2022 Monthly Feature Releases

We had a great 2022 with a ton of feature releases to help you drive a data culture.

Top Solution Authors
Top Kudoed Authors