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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
grggmrtn
Post Patron
Post Patron

Getting a table that lists people that have ONLY ONE specific value in a category

I have the following data:

Person IDDateServiceProvider
104-01-2021SomethingSomeone
105-01-2021AnotherThingSomeoneElse
206-01-2021SomethingSomeoneElse
307-01-2021SomethingSomeone
308-01-2021AnotherThingSomeoneElse
309-01-2021ThirdThingThirdPerson
410-01-2021AnotherThingSomeone
511-01-2021SomethingSomeoneElse
612-01-2021SomethingThirdPerson
613-01-2021ThirdThingSomeone
714-01-2021SomethingSomeone
815-01-2021ThirdThingSomeone

 

I need a list of the people that have any service provided by "Someone" - but ONLY if they have no other services. So the above example should return Person IDs 4, 7 and 8

 

Any ideas on how I can achieve this?

1 ACCEPTED SOLUTION
AlB
Community Champion
Community Champion

Hi @grggmrtn 

The description of the requirement is a bit ambiguous but try the following:

1. Place Table1[ID] in a table visual. Make sure it is set to Don't summarize so that all individual values are shown.

2. Create this measure

Show measure =
VAR check_ =
    CALCULATE ( COUNT ( Table1[Service] ), Table1[Provider] <> "Someone" ) = 0
        && CALCULATE ( COUNT ( Table1[Service] ), Table1[Provider] = "Someone" ) > 0
RETURN
    IF ( check_, 1, 0 )

 3. Place [Show measure] as a filter to the table visual and choose to show when value is 1

 

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

7 REPLIES 7
AlB
Community Champion
Community Champion

Hi @grggmrtn 

The description of the requirement is a bit ambiguous but try the following:

1. Place Table1[ID] in a table visual. Make sure it is set to Don't summarize so that all individual values are shown.

2. Create this measure

Show measure =
VAR check_ =
    CALCULATE ( COUNT ( Table1[Service] ), Table1[Provider] <> "Someone" ) = 0
        && CALCULATE ( COUNT ( Table1[Service] ), Table1[Provider] = "Someone" ) > 0
RETURN
    IF ( check_, 1, 0 )

 3. Place [Show measure] as a filter to the table visual and choose to show when value is 1

 

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

There were a few great responses, but this is the one I tried first - worked like a charm - thanks!!

amitchandak
Super User
Super User

@grggmrtn ,

Create a measure like

 


countx(filter(summarize(Table, Table[Person ID], "_1", countdistinct([Provider]), "_2", calculate(countdistinct([Provider]), filter(Table, Table[Provider] ="Someone"))), [_1] =[_2]),[Person ID])

 

and use with person id in visual

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
AilleryO
Memorable Member
Memorable Member

Another idea, could be using SUMMARIZECOLUMNS to make count grouped by Provider, and finally check that count of Someone is >0 and other counts=0.

Is that of any help ?

amitchandak
Super User
Super User

@grggmrtn , Create a measure like

 


countx(filter(summarize(Table, Table[Person ID], "_1", countdistinct([Provider]), "_2", calculate(countdistinct([Provider]), filter(Table, Table[Provider] ="Someone"))), [_1] =[_2]),[Person ID])

 

and use with person id in visual

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
AilleryO
Memorable Member
Memorable Member

Not easy to answer without a more detailed context. Can a person ID have multiple lines with Someone ?

If not you can use a COUNT<2 based on Person ID, combined with FILTER function...

Tell us more...

 

@AilleryOYeah that's an oops on my part. A Person ID CAN have multiple lines with Someone - and as long as it's ONLY Someone, I need them to be among the results. The COUNT <2 doesn't work for exactly this reason.

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.