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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
DanJohansen
New Member

Create new rows based on From and To values in two columns

Hi, I have a table which looks like this:

Nr.KontoartFrom AccountTo Account
100Managementfee1011010113
110Lejeindtægter1012110124
120Øvrige indtægter1121011212

 

and I would like it to end with this result:

Nr.KontoartAccount
100Managementfee 10110
100Managementfee 10111
100Managementfee 10112
100Managementfee 10113
110Lejeindtægter10121
111Lejeindtægter10122
112Lejeindtægter10123
113Lejeindtægter10124
120Øvrige indtægter11210
121Øvrige indtægter11211
122Øvrige indtægter11212

 

any Ideas for that will be appreciated very much! 

1 ACCEPTED SOLUTION
BA_Pete
Super User
Super User

Hi @DanJohansen ,

 

Assuming your From/To columns are in numerical format, you can add a custom column like this:

 

= {[From Account]..[To Account]}

 

You can then expand the nested list column to new rows.

 

If your original columns aren't numerical, then you'll need to wrap the column references in Number.From:

 

= {Number.From([From Account])..Number.From([To Account])}

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




View solution in original post

4 REPLIES 4
DanJohansen
New Member

Thx Pete! You are a life saver! Whereever you are, have a nice day! 😄

 

 

BA_Pete
Super User
Super User

Hi @DanJohansen ,

 

Assuming your From/To columns are in numerical format, you can add a custom column like this:

 

= {[From Account]..[To Account]}

 

You can then expand the nested list column to new rows.

 

If your original columns aren't numerical, then you'll need to wrap the column references in Number.From:

 

= {Number.From([From Account])..Number.From([To Account])}

 

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Hi Pete! Thx for answering and yes, the two columns are numerical, but I get this error:

DanJohansen_0-1656942500352.png

 

Hi @DanJohansen ,

 

Apologies, I updated my answer with the curly braces that are needed right after I posted, but you'll need to refresh your browser (F5) to see (basically, put curly braces around the whole thing).

 

My bad.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors