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
e116736
Frequent Visitor

Need help to Identify Duplicate field

I am trying to find a formula which Identifies the duplicate address and makes it a 1 but keeps the original instance of that address as a 0. 

6 REPLIES 6
e116736
Frequent Visitor

@Ashish_Mathur Does that example help ?

 

e116736
Frequent Visitor

CustomerID  Customer Address JobType Expected Result

12                    40 Main St             Install           0

13                     11 Water St           Install           0

14                    40 Main St             Verify            1

The goal is to capture the jobs where we went to an address more than one time and exclude those jobs from the totals using the filters on the dashboard

Hi,

This M code works.

let
    Source = Excel.CurrentWorkbook(){[Name="Data"]}[Content],
    Partition = Table.Group(Source, {"Customer Address"}, {{"Partition", each Table.AddIndexColumn(_, "Index",0,1), type table}}),
    #"Expanded Partition" = Table.ExpandTableColumn(Partition, "Partition", {"CustomerID", "JobType", "Index"}, {"CustomerID", "JobType", "Index"})
in
    #"Expanded Partition"

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Thank you. Is there another version of this formula which can be used on the data view/data table side vs the power Query side. Thank you

Hi,

Use this calculated column formula

Column = CALCULATE(COUNTROWS(Data),FILTER(Data,Data[Customer Address]=EARLIER(Data[Customer Address])&&Data[CustomerID]<EARLIER(Data[CustomerID])))+0

Hope this helps.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ashish_Mathur
Super User
Super User

Hi,

Share some data to work with and show the expected result.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

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.

Top Solution Authors