Forum Discussion

dgdgdg122db's avatar
dgdgdg122db
Helper II
6 years ago
Solved

distinct count if

 

Hi,

I wan to see the distinct count of emails which have a total login >= 16 times 

Can someone please help 😞

  • Hi dgdgdg122db ,

     

    We can also use the following measure to meet your requirement:

     

    Measure = 
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Email] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            CALCULATE (
                SUM ( 'Table'[logins] ),
                FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Email] = EARLIER ( 'Table'[Email] ) )
            ) >= 16
        )
    )
    

     


    Best regards,

     

2 Replies

  • Hi dgdgdg122db ,

     

    Try the following measure:

    Count Emails =
    COUNTROWS (
        FILTER (
            SUMMARIZE (
                ALLSELECTED ( 'Table'[email]; 'Table'[Month] );
                'Table'[email];
                "@LoginCount"; SUM ( 'Table'[Logins] )
            );
            [@LoginCount] >= 16
        )
    )

     

    I have used the allselected so if you want to add a slicer by e-mail or month it will return the calcution.

  • v-lid-msft's avatar
    v-lid-msft
    Community Support

    Hi dgdgdg122db ,

     

    We can also use the following measure to meet your requirement:

     

    Measure = 
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Email] ),
        FILTER (
            ALLSELECTED ( 'Table' ),
            CALCULATE (
                SUM ( 'Table'[logins] ),
                FILTER ( ALLSELECTED ( 'Table' ), 'Table'[Email] = EARLIER ( 'Table'[Email] ) )
            ) >= 16
        )
    )
    

     


    Best regards,