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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PeteSil1020
Helper I
Helper I

Ordering a Table from different Datasets

Hello,

 

This has me quite stumped on how to make this possible, but I am going to do my very best at explaining what I am trying to achieve. 

 

Dataset P6:

NameStatus
HenryP6: Last Update

 

Dataset P5:

NameStatus
JillP5: Almost Last Update
JackP5: Almost Last Update

 

Dataset P4:

NameStatus
  

 

Dataset P3:

NameStatus

Peter

P3: Almost First Update
AndrewP3: Almost First Update
CaseyP3: Almost First Update

 

Dataset P2:

NameStatus
RyanP2: Near First Update

 

GOAL:

Create a table that counts all the rows and puts the Name's in order based off Status without showing the status, and adding the row number before each name, while also adding the word UPDATE after each name. It should also check all datasets, and if blank move on to the next dataset.

 

1. Henry UPDATE

2. Jill UPDATE
3. Jack UPDATE
4. Peter UPDATE
5. Andrew UPDATE
6. Casey UPDATE
7. Ryan UPDATE

 

Any insight on how to accomplish in the easiest and best manner will be greatly appreciated.

 

1 ACCEPTED SOLUTION

Hi @PeteSil1020 ,

Please learn more about append.

vrongtiepmsft_0-1706662715975.png

 

The append operation creates a single table by adding the contents of one or more tables to another, and aggregates the column headers from the tables to create the schema for the new table.

When tables that don't have the same column headers are appended, all column headers from all tables are appended to the resulting table. If one of the appended tables doesn't have a column header from other tables, the resulting table shows null values in the respective column.

 

More details: Append queries - Power Query | Microsoft Learn

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
v-rongtiep-msft
Community Support
Community Support

Hi @PeteSil1020 ,

I have created a simple sample, please refer to my pbix file to see if it helps you.

Append the tables.

vrongtiepmsft_0-1706578884145.png

let
    Source = Table.Combine({#"Dataset P6", #"Dataset P5", #"Dataset P4", #"Dataset P3", #"Dataset P2"}),
    #"Added Index" = Table.AddIndexColumn(Source, "Index", 1, 1, Int64.Type),
    #"Removed Columns" = Table.RemoveColumns(#"Added Index",{"Status"}),
    #"Added Custom" = Table.AddColumn(#"Removed Columns", "Custom", each "update"),
    #"Reordered Columns" = Table.ReorderColumns(#"Added Custom",{"Index", "Name", "Custom"})
in
    #"Reordered Columns"

vrongtiepmsft_1-1706578918928.png

 

How to Get Your Question Answered Quickly 

 

If it does not help, please provide more details with your desired output and pbix file without privacy information (or some sample data) .

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

 

 

 

Thank you very much for your response. This is very helpful! Now I have one slight issue. All the data I have right now is currently in this form:

 

NameStatus
JillP5: Almost Last Update
JackP5: Almost Last Update
PeterP3: Almost First Update
CaseyP3: Almost First Update
RyanP2: Near First Update
HenryP6: Last Update
AndrewP3: Almost First Update

 

And my issue is that I know there will be data from other P values that aren't showing, so how can I prepare for those?

Hi @PeteSil1020 ,

Please learn more about append.

vrongtiepmsft_0-1706662715975.png

 

The append operation creates a single table by adding the contents of one or more tables to another, and aggregates the column headers from the tables to create the schema for the new table.

When tables that don't have the same column headers are appended, all column headers from all tables are appended to the resulting table. If one of the appended tables doesn't have a column header from other tables, the resulting table shows null values in the respective column.

 

More details: Append queries - Power Query | Microsoft Learn

 

Best Regards
Community Support Team _ Rongtie

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.