How to do Large Image Transformations for Country Dimension Table

I’m looking to complete a fairly simple transformation in a country table from this dataset.

I wanted to confirm what Power BI users thought a good recommended approach for this scenario would be?

I want to show a SINGLE country on the ROW with an index (from 1) and the PIC on the column and repeated as a column if required. ie Pic1, Pic2, Pic3, Pic4 etc. Here is the current position of the data.

I hoping to make this a dynamic country dimension table with Base64 picture encoding per Chris Webb’s Binary to Image post.

Per Chris’s blog some image names (country names) can be repeated if the image size is larger then the limitations. You can see Europe for example is repeated 4 times so it would need 4 columns to hold each of the repeated rows with the PIC data transposed to each new column. In contrast a smaller picture size only need a single row.

What is the best M code to use to complete this transformation in the Query Editor?

Hi,
See attached, is this what you are looking for?

Paul
country dimension example.xlsx (26.3 KB)

@Paul Thanks I need a single row with Country and duplicated column with each pic field

Hi

Will this help?

Paul
country dimension example 2.xlsx (24.3 KB)

@Paul Yes you have the row repeated once and PIC repeated in column which is correct result.

Hi,
Just to show a proper table, I have made some changes.
Please confirm this is what you are after.
Paul
country dimension example 3.xlsx (25.7 KB)

Sure looks good what transformations did you use?

I take it you have opened the query editor and followed the steps?

Hi @Paul

Thanks for taking time to answer this post but I have found its always better/easy to provide the steps you have taken instead of an attachment which makes people have to download.

Besides your spreadsheet is not English so I cant read the power query inside.

Images or write code in the post always make it easier for users to see comments and how problems were solved too.