The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi,
Can any one please help me to derive below Type Flag as column from Main Num and Alternate Number based on below logic.
if Main Num not repeated in Alternate Number then it's parent
if Main Num is repeated in Alternate Number and also Alternate Number is repeated in Main Number then it's Child- Parent
if Main Num is repeated in Alternate Number and Alternate Number is not repeated in Main Number then it's Child
i have tried below custom column in power query but it's not working for all above three conditions.
#"Added Custom" = Table.AddColumn(#"Filled Down", "Flag", each if List.Contains(#"Filled Down"[number],[associated number]) then "Parent" else "Child")
Solved! Go to Solution.
Hi @paw1 ,
I think you can try this code to create a custom column.
let
_MainNum = #"Changed Type"[Main Num],
_AltNum = #"Changed Type"[Alternate Number]
in
if List.Contains(_AltNum,[Main Num])
then
if List.Contains(_MainNum,[Alternate Number])
then "Child- Parent" else "Child"
else "Parent"
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @paw1 ,
I think you can try this code to create a custom column.
let
_MainNum = #"Changed Type"[Main Num],
_AltNum = #"Changed Type"[Alternate Number]
in
if List.Contains(_AltNum,[Main Num])
then
if List.Contains(_MainNum,[Alternate Number])
then "Child- Parent" else "Child"
else "Parent"
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.