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
Mark022
Regular Visitor

display the total number of people who have selected both type

Mark022_2-1655699119003.png

I have data similar to the above and would like to make a graph.
I can drag and drop "Type" directly to value in Power BI to get the total number of people who have Type A or Type B selected, 

 

Mark022_1-1655699055060.png

How can I display the total number of people who have selected both type? (TYPE A >1 AND TYPE B >1)

1 ACCEPTED SOLUTION
ryan_mayu
Super User
Super User

@Mark022 

you can try this

A&B = 
VAR tbl=SUMMARIZE('Table','Table'[Name],"count",DISTINCTCOUNT('Table'[Type]))
return COUNTROWS(FILTER(tbl,[count]>1))

pls see the attachment below





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

Proud to be a Super User!




View solution in original post

4 REPLIES 4
ryan_mayu
Super User
Super User

@Mark022 

you can try this

A&B = 
VAR tbl=SUMMARIZE('Table','Table'[Name],"count",DISTINCTCOUNT('Table'[Type]))
return COUNTROWS(FILTER(tbl,[count]>1))

pls see the attachment below





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

Proud to be a Super User!




 

Thank you so much.

you are welcome





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

Proud to be a Super User!




Hariharan_R
Solution Sage
Solution Sage

Hi,

Need clarity on how you got 1 for the 3 condition.

You can create one disconnected table with above 3 rows and use the below measure but need to update the "Your Condition" section.

 

 

Count =
SWITCH (
    TRUE (),
    MIN ( 'Type Table'[Types] ) = "Type A>=1",
        CALCULATE (
            COUNTROWS ( 'Type' ),
            'Type'[Type] = "Type A"
                && 'Type'[Name] <> "User B"
        ),
    MIN ( 'Type Table'[Types] ) = "Type B>=1",
        CALCULATE (
            COUNTROWS ( 'Type' ),
            'Type'[Type] = "Type B"
                && 'Type'[Name] <> "User A"
        ),
    MIN ( 'Type Table'[Types] ) = "Type A>=1 and Type B>=1", "Your Condition"
)

 

 Thanks

Hari

Did I answer your question? Then please mark my post as the solution.
If I helped you, click on the Thumbs Up to give Kudos.


My Blog :: YouTube Channel :: My Linkedin


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.