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
dgdgdg122db
Helper II
Helper II

distinct count if

 

Hi,

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

Can someone please help 😞

wqwqwq.PNG

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
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
    )
)

 

1.jpg2.jpg


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-lid-msft
Community Support
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
    )
)

 

1.jpg2.jpg


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
MFelix
Super User
Super User

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.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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.