Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi, hope somebody can assit I need a seperate column to show Top-2 from "Time-Copy.1 and the Cell above Top-2 to equal Top-2 with all other cells to be zero.
Regards Colin
NewStep=Table.FormColumns(Table.ToColumns(PreviousStepName)&{List.ReplaceValue(List.Zip({List.Skip(PreviousStepName[#"Time-Copy.1"]),PreviousStepName[#"Time-Copy.1"]}),"Top-2",0,(x,y,z)=>if List.Contains(x,y) then y else z)},Table.ColumnNames(PreviousStepName)&{"NewColumn"})
Daniel
Thanks although my skills with powery query are limited do I create a custom column and place the formula
Are you refering to this area of the formula
click "fx" before the edit bar and copy these code after "="
Table.FormColumns(Table.ToColumns(#"REMOVED SOURCE NAME")&{List.ReplaceValue(List.Zip({List.Skip(#"REMOVED SOURCE NAME"[Time]),#"REMOVED SOURCE NAME"[Time]}),"Top-2",0,(x,y,z)=>if List.Contains(x,y) then y else z)},Table.ColumnNames(#"REMOVED SOURCE NAME")&{"NewColumn"})
Hi
I tried this okay?
Hi @ColinCowan ,
The double quotes in "=" are for emphasis and do not require double quotes over the equal sign.
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.
Hi thanks yes I tried that previously still did not work
Hi @ColinCowan ,
I don't understand the requirements.
Could you please paste sample data in the correct format (How to provide sample data in the Power BI Forum - Microsoft Power BI Community), and also of the desired output please?
Please check out this article as well: How to Get Your Question Answered Quickly - Microsoft Power BI Community
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries