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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jhearn123
Regular Visitor

One column has unique values but comparing based on column with duplicate values

In PowerBI desktop, I am working on finding unique ID numbers that do not have production plans. 

There are two different tables being referenced, one with production data by unique ID. The other table has different material numbers that make up one unique ID (same as other table). My goal is to find "Material ID" that do not have production data. 

I used the below DAX 

CALCULATE(DISTINCTCOUNT('ProductionTable'[Unique ID]),FILTER('ProductionTable', 'ProductionTable'[Unique ID] = EARLIER('MaterialTable'[Unique ID])))

This returns a "1" for the "Unique ID" in MaterialTable when there is production data for that "Unique ID" in the ProductionTable. 
The problem is that multiple "Unique IDs" use the same "Material ID". I am trying to find only the values that do not have a "1" correlated to any row of the "Material ID".  The example below shows this visually. 
jhearn123_0-1678388271197.png

"Unique ID" 234234 and "Unique ID" 313134 both use Material ID 123456 but only "Unique ID" 234234 has production planned. I need to isolate the Material IDs like 654321 that does not have Production Planned for ALL instances of that Material ID. Filtering by blanks does not work as the Unique ID 313134 row would give a blank for Material ID 123456 but this Material ID is being used.

I hope this makes sense and any help is appreciated! 



2 REPLIES 2
amitchandak
Super User
Super User

@jhearn123 , Based on what I got try measure like

 

CALCULATE(DISTINCTCOUNT('ProductionTable'[Unique ID]),FILTER('ProductionTable', 'ProductionTable'[Material ID] = EARLIER('MaterialTable'[Material ID])))

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

@amitchandak unfortunately that does not work as the 'ProductionTable' does not contain the value MaterialID. The relationship between the two tables is the UniqueID. But multiple UniqueIDs can use a single MaterialID, so need to eliminate MaterialIDs that have any UniqueIDs in 'ProductionTable'

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.