Forum Discussion
New custom column
- Anonymous3 years ago
Hi Sudheeshp ,
This is my easy-to-understand method.
1.Add a custom column to return 1 or 0.
2.Group by as follows.
3.Add a custom to return the result.
4.Expand the Tables in the column.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
See the code here (You will need to replace Source appropriately)
let
Source = Excel.CurrentWorkbook(){[Name="Table2"]}[Content],
ListNonBlanks = List.Buffer(List.Transform(List.Select(Table.ToRecords(Source), (x) => x[Promo ID] <> null), (x) => x[Unique Customer])),
#"Added Custom" = Table.AddColumn(Source, "ID VFP Customer", each if List.Contains(ListNonBlanks, [Unique Customer]) then "Y" else "N")
in
#"Added Custom"
- Sudheeshp3 years agoFrequent Visitor
I have to add as a custom column and apply this, is it??The following is my source!!
Folder.Files("C:\INVENTORY\YEAR\ALL FILES\RETAIL SALES\DAILY SALES\VFP ANALYSIS")
- Vijay_A_Verma3 years agoMost Valuable Professional
Open your file in PQ and in the code generated, copy the code ListNonBlanks till the end and paste into your code after Source.
- Sudheeshp3 years agoFrequent Visitor
Well, I am getting errors. I think the unique customer is a additional colu mn, and there are columns added in the power query, after importing