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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Combine Excel Files That Contains Photos

Can we combine multiple excel files that contains photos? I tried combining two excel files that contains photos yet the column is showing it's empty. 

Thanks!

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you please try to verify if you can see the binary type of your image in Power Query Editor? Power BI cannot show binary data directly, we can only convert it to text to show it based on this similar thread: https://community.powerbi.com/t5/Desktop/How-to-use-Images-Stored-in-a-SQL-Server-Table-with-Power-BI/td-p/383111


Best regards,

 

Community Support Team _ Dong Li
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
Jimmy801
Community Champion
Community Champion

Hello @Anonymous 

 

to extract photos from an Excel-file you have to use a different approach. You have to unzip the file and read it's content.

Here a code example to filter all JPG-file of one file

let
    Source = UnzipContents( File.Contents("C:\test\Mappe1.xlsx")),
    UnzipContents = (ZIPFile) =>
    //used from http://sql10.blogspot.com/2016/06/reading-zip-files-in-powerquery-m.html
let
    Header = BinaryFormat.Record([
        MiscHeader = BinaryFormat.Binary(14),
        BinarySize = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger32, ByteOrder.LittleEndian),
        FileSize   = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger32, ByteOrder.LittleEndian),
        FileNameLen= BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger16, ByteOrder.LittleEndian),
        ExtrasLen  = BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger16, ByteOrder.LittleEndian)    
    ]),
 
    HeaderChoice = BinaryFormat.Choice(
        BinaryFormat.ByteOrder(BinaryFormat.UnsignedInteger32, ByteOrder.LittleEndian),
        each if _ <> 67324752             // not the IsValid number? then return a dummy formatter
            then BinaryFormat.Record([IsValid = false, Filename=null, Content=null])
            else BinaryFormat.Choice(
                    BinaryFormat.Binary(26),      // Header payload - 14+4+4+2+2
                    each BinaryFormat.Record([
                        IsValid  = true,
                        Filename = BinaryFormat.Text(Header(_)[FileNameLen]),
                        Extras   = BinaryFormat.Text(Header(_)[ExtrasLen]),
                        Content  = BinaryFormat.Transform(
                            BinaryFormat.Binary(Header(_)[BinarySize]),
                            (x) => try Binary.Buffer(Binary.Decompress(x, Compression.Deflate)) otherwise x
                        )
                        ]),
                        type binary                   // enable streaming
                )
    ),
 
    ZipFormat = BinaryFormat.List(HeaderChoice, each _[IsValid] = true),
 
    Entries = List.Transform(
        List.RemoveLastN( ZipFormat(ZIPFile), 1),
        (e) => [FileName = e[Filename], Content = e[Content] ]
    )
in
    Table.FromRecords(Entries),

    FilterJPG = Table.SelectRows(Source, each ([FileName] = "xl/media/image1.jpg"))
in
    FilterJPG

 

Copy paste this code to the advanced editor in a new blank query to see how the solution works.

If this post helps or solves your problem, please mark it as solution (to help other users find useful content and to acknowledge the work of users that helped you)
Kudoes are nice too

Have fun

Jimmy

edhans
Super User
Super User

Power Query cannot see Excel images in a file. Those images are not in the table but float above it in a graphics layer. Same with all other objects like charts, icons, and any arrows or other graphics you can put in there via the INSERT ribbon in Excel. That is why PQ is showing the columns are empty.



Did I answer your question? Mark my post as a solution!
Did my answers help arrive at a solution? Give it a kudos by clicking the Thumbs Up!

DAX is for Analysis. Power Query is for Data Modeling


Proud to be a Super User!

MCSA: BI Reporting
v-lid-msft
Community Support
Community Support

Hi @Anonymous ,

 

Could you please try to verify if you can see the binary type of your image in Power Query Editor? Power BI cannot show binary data directly, we can only convert it to text to show it based on this similar thread: https://community.powerbi.com/t5/Desktop/How-to-use-Images-Stored-in-a-SQL-Server-Table-with-Power-BI/td-p/383111


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.