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
Anonymous
Not applicable

Create 3 different tables from a single sheet in excel

Hello Power BI experts, 

I have a summary report that has data from three from different years, lets say 2018, 2019 and 2020.

 

The below three tables are in the same sheet of excel. Also, note that these column names are different and the tables have different sizes. I want to have all these tables as separate tables in one Power BI report.

 

Is there an efficient way to import tables into my report, I can write an M code to separate the tables out and extract them as three different tables. Also, one important point is that these reports are created from a portal and I get these reports everyday and that I will connect with Power BI. In these automated reports, the tables are also not named. 

 

Can anyone help with this? Thank you so much 

 

2018 ABCD
 Revenue1102110

 

2019 EFGHI
Revenue 110  21101

 

2020JK
Revenue $                1 $                   1
1 ACCEPTED SOLUTION
V-pazhen-msft
Community Support
Community Support

@Anonymous 

In order to optimize the performance, instead of create calculated table using DAX, I would recommend you to transform the query in Query Editor to create the 3 tables.

 

The idea is first create an index column and make another 2 copies of the table. On each table you can filter the index column with <6, >6 and <13, >13 respectively. Then promote headers and remove null columns.

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

View solution in original post

3 REPLIES 3
V-pazhen-msft
Community Support
Community Support

@Anonymous 

In order to optimize the performance, instead of create calculated table using DAX, I would recommend you to transform the query in Query Editor to create the 3 tables.

 

The idea is first create an index column and make another 2 copies of the table. On each table you can filter the index column with <6, >6 and <13, >13 respectively. Then promote headers and remove null columns.

 


Paul Zheng _ Community Support Team
If this post helps, please Accept it as the solution to help the other members find it more quickly.

mahoneypat
Employee
Employee

Please share a link to the excel sheet with your example data to see how they are spaced out.  Since you are getting the file automatically, I expect you can't convert them to Excel tables to make them easier to bring into the query.  Also, you should consider unpivoting your three tables and appending them to one table to make your analysis and visualization easier.

 

Regards,

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


Anonymous
Not applicable

 

Thanks for the reply Pat, I cannot really unpivot the data and make a combined since they have different column headers etc. What I am currently thinking is to create a calculated table and write a DAX that will always fetch the rows, say 1-6 and make a separate table, then fetch the rows 7-12 for the second table and so on. Is there an easier approach you can recommend? Below is the link to my sample data. 

 

https://docs.google.com/spreadsheets/d/1WQ6n6FKM5ZjAnndcfY9xCoY-1IaTN5dAnckT0IXzz7E/edit?usp=sharing

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.

Top Solution Authors
Top Kudoed Authors