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
Anonymous
Not applicable

DAX Code that pulls out values when they differentiate between columns

Is there a way to to pull out rows that have a duplicate value in one column but different value in another column

 

EX.PNG

 

So when I load this dataset into PowerBI, I want to to pull out IDs 1 and 3, and pull out the two programs that their two programs (1:Grocery/Supermarket, 3:Retail/Supermarket).

Currently my DAX code looks like

 

 

 

dupecounter = CALCULATE(
             COUNTA('Data'[ID]),
             FILTER('Data', 'Data'[Program] <> EARLIER('Data'[Program])
       ))

 

 

But its not quite doing what I need it to do

2 REPLIES 2
V-lianl-msft
Community Support
Community Support

Hi @Anonymous ,

 

Create a measure like this and apply it to visual level filter.

Measure 4 = CALCULATE(DISTINCTCOUNT('Table (2)'[Program]),ALLEXCEPT('Table (2)','Table (2)'[ID]))

V-lianl-msft_1-1604382117453.png

 

 

Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@Anonymous , Output you want is not clear. This measure with id column should give you 1,3

countx(filter(summarize('Data', 'Data'[ID] , "_1",COUNTA('Data'[ID])) ,[_1]>1),[ID])

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.