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
Wmickle
Frequent Visitor

How to group row values for distinct count

Data table includes columns for email addresses, name of email sent and column that identifies whether it was opened or not (True\False valuse) I want to create a chart that shows; count of distinct email addresses that did not open any of the email names sent to their email address.

 

 Example below distinct count would be 0 since email address opened at least 1 email.

 

Email addressemail nameopened
xyz.comApplesFalse
xyz.comBannanasFalse
xyz.comOrangesTrue

 

2nd example below, distinct count to be 1 since email address did not open any emails. 

 

Email addressemail nameOpened
abc.comApplesFalse
abc.comBannanasFalse
abc.comOragnesFalse

 

 

 

2 ACCEPTED SOLUTIONS
AlB
Super User
Super User

Hi @Wmickle 

You talk about a chart but mention only one dimension you want to show? Place this measure in a card visual:

Measure =
COUNTROWS (
    FILTER (
        DISTINCT ( Table1[EmailAddress] ),
        CALCULATE ( SUMX ( Table1, Table1[Opened] * 1 ) ) = 0
    )
)

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

View solution in original post

v-yingjl
Community Support
Community Support

Hi @Wmickle ,

Based on your description, you can create a measure like this:

Distinct =
IF (
    COUNTX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Email address]
                IN DISTINCT ( 'Table'[Email address] )
                    && 'Table'[opened] = TRUE ()
        ),
        [Email address]
    ) >= 1,
    0,
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Email address] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Email address] IN DISTINCT ( 'Table'[Email address] )
        )
    )
)

distinct.png

Attached a sample file in the below, hopes to help you.

 

Best Regards,
Community Support Team _ Yingjie 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

3 REPLIES 3
v-yingjl
Community Support
Community Support

Hi @Wmickle ,

Based on your description, you can create a measure like this:

Distinct =
IF (
    COUNTX (
        FILTER (
            ALL ( 'Table' ),
            'Table'[Email address]
                IN DISTINCT ( 'Table'[Email address] )
                    && 'Table'[opened] = TRUE ()
        ),
        [Email address]
    ) >= 1,
    0,
    CALCULATE (
        DISTINCTCOUNT ( 'Table'[Email address] ),
        FILTER (
            ALL ( 'Table' ),
            'Table'[Email address] IN DISTINCT ( 'Table'[Email address] )
        )
    )
)

distinct.png

Attached a sample file in the below, hopes to help you.

 

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

Thank you for your help. I appreciate you.

 

AlB
Super User
Super User

Hi @Wmickle 

You talk about a chart but mention only one dimension you want to show? Place this measure in a card visual:

Measure =
COUNTROWS (
    FILTER (
        DISTINCT ( Table1[EmailAddress] ),
        CALCULATE ( SUMX ( Table1, Table1[Opened] * 1 ) ) = 0
    )
)

Please mark the question solved when done and consider giving a thumbs up if posts are helpful.

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

Cheers 

SU18_powerbi_badge

 

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.

Top Solution Authors
Top Kudoed Authors