Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Distinct Count with text column condition

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

Case noYes Column
12 
12 
12Yes
13 
13Yes
13Yes

 

 

 

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!!

 

  • 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
        )
    )
    

6 Replies

  • 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
        )
    )
    
    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi,

      Thankyou. This measure works the best.

      Regards,

      Shubham

  • 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's avatar
      Anonymous
      Not applicable

      Thankyou for replying.

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

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thankyou for replying.