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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Anonymous
Not applicable

Recursive issue

Hello everyone,

 

I have a table similar to this one :Capture.PNG

So the first column is the name of an object and the generation (I, II, III, IV, ...), second column correspond to the previous generation of this object, and the last one is the name of a contact associated to this object. I would like to have a table similar to this :Capture2.PNG

So I would then be able to filter on my report on a Name, and see ALL the previous generations of this object and the contact associated.

I have coded similar things in Python but I have no clue about how to do it on Power Bi (M language or DAX).

 

Thank you very much for your help !

Gautier 

1 REPLY 1
wdx223_Daniel
Super User
Super User

try this M code

NewStep=let gens={"IV","III","II","I"} in #table(Table.ColumnNames(PreviousStepName),List.TransformMany(Table.ToRows(PreviousStepName),each let a=List.Skip(gens,(x)=>not List.Contains(Text.Split(_{1}," "),x)) in if a={} then {_} else List.Transform(a,(x)=>Text.Combine(Splitter.SplitTextByAnyDelimiters(gens)(_{1}),x)),(x,y)=>{x{0},y,x{2}}))

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.