Forum Discussion
Add columns to identify value that were not there the date before
Hello,
I'm looking to add a column to identify the values that were not there the date before my last update.
So every couple day I add data to my excel file and I want to identify if the value is or is not in the column name. If it is a new name I want to return "Yes" and if not "no". Plus In the same day it could happen that I have the same name, but I need to be included as yes.
thanks for your help.
David
Hi Daleb ,
According to your description, here's my solution.
1.Add an index column. As your data are ranked by date, to identify if there is same name in the same day, we need an index column.
2.Add a custom column in Power Query:
if Table.SelectRows(#"Added Index",(x)=>x[Name]=[Name] and x[Index]<[Index])[Name]={} then "No" else "Yes"Or if you prefer a calculated column:
Column = IF ( COUNTROWS ( FILTER ( 'Table', 'Table'[Name] = EARLIER ( 'Table'[Name] ) && 'Table'[Index] < EARLIER ( 'Table'[Index] ) ) ) > 0, "Yes", "No" )Get the correct result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
1 Reply
- v-yanjiang-msft
Community Support
Hi Daleb ,
According to your description, here's my solution.
1.Add an index column. As your data are ranked by date, to identify if there is same name in the same day, we need an index column.
2.Add a custom column in Power Query:
if Table.SelectRows(#"Added Index",(x)=>x[Name]=[Name] and x[Index]<[Index])[Name]={} then "No" else "Yes"Or if you prefer a calculated column:
Column = IF ( COUNTROWS ( FILTER ( 'Table', 'Table'[Name] = EARLIER ( 'Table'[Name] ) && 'Table'[Index] < EARLIER ( 'Table'[Index] ) ) ) > 0, "Yes", "No" )Get the correct result:
I attach my sample below for your reference.
Best regards,
Community Support Team_yanjiang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.