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

Remove duplicate column

Hi,

 

I want to see distinct values of a column in my table. Also I want to see the rest of the columns as well using distinct values for only one column.

 

I tried removing the duplicates in power query editor but when I applied the changes i got this error "object reference not set to an instance of an object"

 

Please let me know if I used DAX or I can do it using query editor

9 REPLIES 9
Anonymous
Not applicable

Hi @Anonymous 

Could you tell me if your problem has been solved? If it is, kindly Accept the helpful reply as a solution. More people will benefit from it. Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.

 

Best Regards,

Rico Zhou

amitchandak
Super User
Super User

@Anonymous ,

New Table = distinct(Table)

 

or New table = summarize( Table, Table[Col1] ,,,,) give all columns

https://radacad.com/aggregated-table-in-power-bi-summarize-function-in-dax

 

for object reference - https://community.powerbi.com/t5/Issues/Object-reference-not-set-to-an-instance-of-an-object/idi-p/981144

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
DataZoe
Microsoft Employee
Microsoft Employee

@Anonymous You have a few approaches to choose from. 

 

In DAX you can create a calculated table:

 

Distinct Values = summarizecolumns('Table'[Value])

or

Distinct Values = Summarize('Table','Table'[Value])

 

Or just use a table visualization, which will dedup a list when you put in any field.

 

To get a distinct count of a items in a column:

 

Distinct = distinctcount('Table'[Value])

 

I'm not sure I've seen that error you are seeing in the PowerQuery window, but you should be able to remove duplicate values there too with the remove duplicates transformation. 

Respectfully,
Zoe Douglas (DataZoe)



Follow me on LinkedIn at https://www.linkedin.com/in/zoedouglas-data
See my reports and blog at https://www.datazoepowerbi.com/

Anonymous
Not applicable

@DataZoe    Distinct Values = Summarize('Table','Table'[Value])

 

I tried using this formula but i get only one column and I want to see thes rest othe columns as well since I have to create measures and calculated columns in this table.

@Anonymous , Try distinct

New Table = distinct(Table)

In summarize give all column names. refer Post I shared last

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

@amitchandak  I tried doing both but it doesn't work, it gives me the same table as it is

@Anonymous - You will need to aggregate and use SUMMARIZE or GROUPBY:

Table =  SUMMARIZE('Table',[Column you want distinct],"Column1",MAX([Column1]),"Column2",MAX([Column2]))

Not really enough information to go on, please first check if your issue is a common issue listed here: https://community.powerbi.com/t5/Community-Blog/Before-You-Post-Read-This/ba-p/1116882

Also, please see this post regarding How to Get Your Question Answered Quickly: https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

The most important parts are:
1. Sample data as text, use the table tool in the editing bar
2. Expected output from sample data
3. Explanation in words of how to get from 1. to 2. 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

@Greg_Deckler This worked! Thank you

@Anonymous Boom! 



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

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.