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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
rodfernandez
Helper I
Helper I

Create a table in power query from another table

Hello everybody,

I am new to Power Bi and I would like you to help me with the creation of a table. I think it's simple but none of the ways I've tried has worked

I have this data table, which has the following columns "Code", "Date" and "Type"

 

CodeDateType
00101-01-2021A
00102-01-2021B
00105-01-2021C
00110-01-2021B2
00111-01-2021C2
00201-01-2021A
00205-01-2021B
00207-01-2021C
00304-01-2021A
00305-01-2021B
00401-01-2021A
00402-01-2021B
00403-01-2021A2
00407-01-2021B2
00411-01-2021A3




And that reflects the dates that the activities of the following process were carried out

rodfernandez_0-1621368087379.png

what I want to achieve in power query is a table like this

CodeA-BB-CC-B2B2-C2B-A2A2-B2B2-A3
0011111   
00211     
0031      
0041   111



the number of loops that can occur in the process is unknown, so Table 2 has to be created from scratch from Table 1

This is a table where all movements are marked with a 1 for each code.

For example, for code 004, it started at "A" then went to "B", then column "A-B" was marked with a 1, then it went back from "B" to "A2", so column "B-A2" was marked with a 1, etc ...

If someone could help me I would be very grateful

Thank you

1 ACCEPTED SOLUTION
samdthompson
Memorable Member
Memorable Member

Hello, heres a link to a solution for you. Probably, you want to supress loading of the start and end tables but have left so you can see the logic.

 

ProcessFlowExample 

 

// if this is a solution please mark as such. Kudos always appreciated.

View solution in original post

3 REPLIES 3
samdthompson
Memorable Member
Memorable Member

Hello, have fixed in the file i uploaded before (ProcessFlowExample). Just needed one more step introduced

 

// if this is a solution please mark as such. Kudos always appreciated.
samdthompson
Memorable Member
Memorable Member

Hello, heres a link to a solution for you. Probably, you want to supress loading of the start and end tables but have left so you can see the logic.

 

ProcessFlowExample 

 

// if this is a solution please mark as such. Kudos always appreciated.

It is almost perfect, Thanks :), the only thing that is not correct is that it is joining the last type of a code with the first type of the following code,
for example for the code "001" the flow "C2-A" appears, where that is impossible. The last type of "001" (C2) is being joined with the first of "002" (A)

ejemplofoto.png

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

Power BI Carousel June 2024

Power BI Monthly Update - June 2024

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

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.