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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
Rahul_SC
Helper IV
Helper IV

Finding common names under a group by Dax

Hi,

 

I have a table like below. I would like find find common names present in the table. 

 

Data structure - the names will name be same under unique ID and under unique sub ID. But it could be same if unique ID and unique sub ID changes. I want common names to be present like the last column as an output using dax. Appreciate your guidance on this.

 

Thanks.

 

Unique IDUnique Sub IDNameCommon Names under unique ID
A1JackJack
A1RajeshRajesh
A1Karan 
A2RajeshRajesh
A2JackJack
A2Ani 
B3Jack 
B3KaranKaran
B4KaranKaran
B4Clark

 

1 ACCEPTED SOLUTION

@Rahul_SC , try like

 

New Measure=

var _cnt = countx(filter(allselected(Table) , [Unique ID] = Max([Unique ID]) && [Name] = Max([Name]) ), [Name])

return

if(_cnt >1, [Name], blank())

 

 

or

 

New Measure=

var _cnt = countx(filter(allselected(Table) , [Unique ID] = Max([Unique ID]) && [Name] = Max([Name]) ), [Name])

return

if(_cnt >1, [Name], "")

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

View solution in original post

4 REPLIES 4
amitchandak
Super User
Super User

@Rahul_SC , Based on what I got

 

New colum =

var _cnt = countx(filter(Table, [Unique ID] = earlier([Unique ID])  && [Name] = earlier([Name]) ), [Name])

return

if(_cnt >1, [Name], blank())

 

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

Hi @amitchandak ,

 

thanks for responding, can you please create it in measure ? not column. 

@Rahul_SC , try like

 

New Measure=

var _cnt = countx(filter(allselected(Table) , [Unique ID] = Max([Unique ID]) && [Name] = Max([Name]) ), [Name])

return

if(_cnt >1, [Name], blank())

 

 

or

 

New Measure=

var _cnt = countx(filter(allselected(Table) , [Unique ID] = Max([Unique ID]) && [Name] = Max([Name]) ), [Name])

return

if(_cnt >1, [Name], "")

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 , amazing logic. It works. Thank you.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.