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

Expand multiple tables with different, varied headers

I have an iterative API call in Column 4 (variables in columns 1-3). Then, I invoke the API function and get a table returned for each line. The tables contain different data (different column names, column numbers) than each other. As you can imagine, expanding these tables the typical BI way isn't effective, as I end up with rows of values and a row of headers that aren't consistent. What I'd like to do is (prior to expanding each table) pivot the header row so each table looks like {Attribute, Value}. Then when expanding, the data is consistent through the two remaining columns.

 

How do I do this? I can't find a way to access each table before expansion unless there's a way to store and append tables within variables in M? Is there something else I'm missing? Below is a sample of the table data post expansion (actual file is sensitive)

 

Attr1Attr2Attr3APIcol1APIcol2APIcol3APIcol4APIcol5
asdfadfadfDateTableAppleTableOrangeTableBananaTablePineapple
asdfadfadfOct 55789
asdfadfadfOct 1231810
asdfasasDateTableTruckTableCar  
asdfasasOct 510  
asdfasasOct 1222  

 

2 REPLIES 2
Fowmy
Super User
Super User

@Anonymous 

If you have the possibility to create a dummy file with sample data and share the expected result then, it will give a handle to work out a solution.

________________________

If my answer was helpful, please consider Accept it as the solution to help the other members find it

Click on the Thumbs-Up icon if you like this reply 🙂

YouTube  LinkedIn 

Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Anonymous
Not applicable

@Fowmy Below is a link to my sample file. Unfortunately, I do not know how to make a column of different tables, but the file reflects how the data looks upon expansion. Note that I have several hundred of these tables so an automated solution is necessary.

 

https://1drv.ms/u/s!AuFhcdA3iSEvgdNTOZopROFpPB4pAw?e=3Lgue7

 

My expected output is ideally as follows (based on the file, numbers differ from example above slightly), but suggestions are welcome.

 

APIParam1APIParam2DateUnpivotedAttributeUnpivotedVal

thing1

thing2

Oct 5

TableApple2

thing1

thing2

Oct 12TableApple9

thing1

thing2

Oct 5

TableOrange25

thing1

thing2

Oct 12TableOrange8

thing1

thing2

Oct 5

TableBanana5

thing1

thing2

Oct 12TableBanana7

thing1

thing2

Oct 5

TablePineapple

2

thing1

thing2

Oct 12TablePineapple1

thing1

thing2

Oct 5

TableTruck75

thing1

thing2

Oct 12TableTruck4

thing1

thing2

Oct 5

TableCar6

thing1

thing2

Oct 12TableCar4

 

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.