Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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