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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
aloosh89
Helper I
Helper I

Return table of ID's for which a specific Attribute value doesn't appear

Hi,

 

Below is a sample table: 

 

IDAttributeName
1AAlex
1BAlex
1CAlex
2BJohn
2CJohn
2DJohn
3ADebra
3BDebra
3CDebra
4BLana
4CLana
4DLana

I want to create a table (using calculatetable or similar) which returns all the ID's for which the Attribute value 'A' doesn't occur. Hence for the sample above, the result would be a table produced which looks like this:

 

IDName
2John
4Lana

 

Appreciate the help.

 

Thanks,

Ali 

1 ACCEPTED SOLUTION
parry2k
Super User
Super User

@aloosh89 try this:

 

 

New Table = 
VAR __ExcludeTable = CALCULATETABLE ( VALUES ( MyTable1[ID] ), MyTable1[Attribute] = "A" ) 
VAR __RestTable = EXCEPT ( VALUES ( MyTable1[ID] ), __ExcludeTable )
RETURN
SUMMARIZE ( 
        NATURALINNERJOIN ( MyTable1, __RestTable ),
        [ID],
        [Name]
    )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

View solution in original post

6 REPLIES 6
parry2k
Super User
Super User

@ThxAlot actually with a larger table, your DAX expression is taking longer, not sure why.



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

parry2k
Super User
Super User

@ThxAlot Good option but I reviewed the performance, not much of a difference. 🤷‍♀️



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

ThxAlot
Super User
Super User

Simple enough,

ThxAlot_0-1696448828041.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LearnAndPractise(Everyday)


)



@ThxAlot I am trying to implement this. If I have an additional column in the table, let's call it 'Attribute 2' which I want to use filter some of the rows, where in the expression would I add that additional filtering? I have an example below, let's say I want to do exactly as requested in the original post, but also filter out rows by 'Attribute2 = x' only independant of what attribute1 is. So in this example the only row returned would be one row for John. 

 

IDAttributeNameAttribute2
1AAlexx
1BAlexx
1CAlexx
2BJohnx
2CJohnx
2DJohnx
3ADebrax
3BDebrax
3CDebrax
4BLanay
4CLanay
4DLanay

 

parry2k
Super User
Super User

@aloosh89 try this:

 

 

New Table = 
VAR __ExcludeTable = CALCULATETABLE ( VALUES ( MyTable1[ID] ), MyTable1[Attribute] = "A" ) 
VAR __RestTable = EXCEPT ( VALUES ( MyTable1[ID] ), __ExcludeTable )
RETURN
SUMMARIZE ( 
        NATURALINNERJOIN ( MyTable1, __RestTable ),
        [ID],
        [Name]
    )

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

@parry2k this solution works perfectly, thanks so much and sorry for the delayed response.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors