Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Accessing SQL Blobs

Hi:

An ERP application stores document attachments in SQL as Blobs.

Is it possible for Power BI to access attachments for those who want to open, say, PDFs in a Power BI dashboard or report? If so, how?

Thank you!

John

  • Yes, Power Query has a "Binary" data type that you can then bend to your will, for example by declaring that you want to read that binary as a PDF.

     

    Just add the blob to your SQL view columns.

     

    Here's an example where I pull a bunch of CSV files out of their blobs (the [Content] column)  

     

     #"Invoke Custom Function1" = Table.AddColumn(#"Renamed Columns1", "CSV", each #"Get CSV file"([Content])), 

     

    via a custom function where I do some basic transforms:

     

    Get CSV File = 

     

    (File) => let
    Source = Csv.Document(File,[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),

    ....

  • Anonymous's avatar
    Anonymous
    6 years ago

    Thank you.  I apologize, for getting upset.

    How can that, at least, be done?  I cannot find any good and clear instructions on doing so.

13 Replies

  • Yes, Power Query has a "Binary" data type that you can then bend to your will, for example by declaring that you want to read that binary as a PDF.

     

    Just add the blob to your SQL view columns.

     

    Here's an example where I pull a bunch of CSV files out of their blobs (the [Content] column)  

     

     #"Invoke Custom Function1" = Table.AddColumn(#"Renamed Columns1", "CSV", each #"Get CSV file"([Content])), 

     

    via a custom function where I do some basic transforms:

     

    Get CSV File = 

     

    (File) => let
    Source = Csv.Document(File,[Delimiter=",", Encoding=1252, QuoteStyle=QuoteStyle.Csv]),
    #"Promoted Headers" = Table.PromoteHeaders(Source, [PromoteAllScalars=true]),

    ....

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi:

      You mentioned "Power Query".  What about Power BI?

      John

    • Anonymous's avatar
      Anonymous
      Not applicable

      Frankly, I don't understand any of what you said.  Can you please supply some simple steps?  Does this sort of thing require prorgramming?  Can you not view the PDF attachments in Power BI?

      • lbendlin's avatar
        lbendlin
        Super User

        Power BI is a Data Analytics tool, not a picture viewer.  There is a PDF visual somewhere but I think it is broken/unsupported.

         

        What Power BI (Power Query) offers is a way to extract data from PDF files, like table data etc.

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks, Amy!

      Would the same thing work for PDFs, as well as CSVs?

      John

  • There is another alternative that may interest you to solve the problem,

    Indirectly you can create an extractor externally (by programming it) to read the blob and build the file temporarily then you could reach that file through a link for that record:

     

    You have this:

     

    Then: