Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Path function in Power Query

Hi Guys,

 

I want to use this DAX formule in Power Query. 

 

Path = IF(Medewerkers[Active] = "true", PATH(Medewerkers[Email],Medewerkers[Manager Email]),BLANK())

 

So I tried the following codes in Power Query. But I am getting error about Stackoverloop. I realy dont know what does it means.

cr7_0-1625746525966.png

 

let 
     myfunction=(myvalue)=>
                    let
                    mylist=Table.SelectRows(Timestamp,each [Email]=myvalue)[Manager Email],
                    result=Text.Combine(mylist)
                    in
                    if result= null or result ="" then "" else if @myfunction(result)=null or @myfunction(result)="" then result else result & "|" & @ myfunction(result)
in
Text.Combine(List.Reverse(List.RemoveItems({[Email]}&{[Manager Email]}&Text.Split(myfunction([Manager Email]),"|"),{"",null})),"|")

 

 

Thanks in advance!

1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

Please see this article.  It provides a way to do PATH equivalent with M in your query.  One of the selectable outputs matches the output by the PATH function.  It also has fewer limitations that the PATH function (see article).

Guest Post: Using List.Accumulate for Input/Output Genealogy – The BIccountant

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi Anonymous, I am facing very similar situation as you - I have both condition and path function in DAX that I need to translate to M. I have been trying to write it according to the enclosed webpage but it is still not working. The condition is just always wrong. Can you maybe share how you combined IF and PATH and it worked? Thank you very much for any guidance!

mahoneypat
Microsoft Employee
Microsoft Employee

Please see this article.  It provides a way to do PATH equivalent with M in your query.  One of the selectable outputs matches the output by the PATH function.  It also has fewer limitations that the PATH function (see article).

Guest Post: Using List.Accumulate for Input/Output Genealogy – The BIccountant

 

Pat

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.