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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Displaying number of duplicates per column in a table

Hi all,

I currently have the following data set and wanted to create a table which would display information about each column, such as the number of null values and the number of duplicate values. 

 

Data:

Gaurav97_0-1627553019997.png

 

I have created a Query which gets me the Null values, but cannot figure out how to display or calculate the number of duplicate values in each column.

 

Query:

Gaurav97_1-1627553171080.png

 

Is there a way in which i can count the duplicate values for each column so it can be displayed in a table similar to the one in query? Would ideally like to have another column called "DuplicateCount". 

 

Thanks!

 

 

2 REPLIES 2
v-yetao1-msft
Community Support
Community Support

Hi @Anonymous 

1.Add an index column in the Query Editor.

2.Add a calculated column with this formula.

Column =CALCULATE ( COUNT ( Table[Column] ), Table[Index] <= EARLIER ( Table[Index] ) )

Best Regards

Community Support Team _ Ailsa Tao

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

lbendlin
Super User
Super User

You know that this functionality is built into Power Query Editor, right?  View...Column Quality.

 

If you must do it yourself you can compare the row count to the distinct count, or create a grouping by value and count the number of occurrences for each value.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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