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

Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM. Register now.

Reply
Anonymous
Not applicable

Accessing Binary Columns from Oracle Database

Hello,

I recently got access to an Oracle DB and it's connected now to Power BI. The problem is that 3 columns in the database are binary columns and I can't view their data.

COLUMN_NAMEDATA_TYPECOMMENTS
DATA_ARRAY1BLOBBinary data
DATA_ARRAY2BLOBBinary data
FILEBLOBBinary data


And this is how it appears on Power Query:

sarah931_2-1706298799218.png


And here is what I have when I click on the Binary:

sarah931_1-1706298696812.png

I got some insights from The DB Admin and I am quoting him in the following:
- "The binary data in DATA_ARRAY1 and DATA_ARRAY2 are integer arrays with 3700 elements. Defined as: int data1[3700], int data2[3700] they are not an array type in the database.they are BLOB."
- He used a C# code to break that binary image into the correct format.  (Not sure if we will need it to decode the data)
- "The binary image will have to be broken into 32 bit lengths for each element of the array. The binary image has all elements for the entire array just all stuck together. If you had a hex editor (or binary) and looked at that binary image you could see the individual elements of the array."
- "If power BI has the ability to allow you to save that binary image into a file then you could open that file up with a hex editor and see how the data is arranged. I think an integer array is saved in the image in order. element 0 of the array should be bits 1 -  32. and element 1 should be bits 33 - 64, etc.."


I haven't worked with Binary Data before and am not familiar with this type of manipulation. I am seeking your help either to solve the problem or to understand the process better. Any assistance you can provide in guiding me through the steps or informing me about the necessary information I should get from the DB Admin would be greatly appreciated.

1 ACCEPTED SOLUTION

1. just add the serial number as a column before you transform the blobs - it will automatically be expanded with the other columns.

2. as long as you keep the table narrow Power BI has no issues with billions of rows. If you want to be cute you can consider incremental refresh.

3. That was not part of the sample data - But what you can do is cut the BLOBs  into chunks of 4xDATA_POINTS first and then take the first list item for each serial number, and process that.

View solution in original post

13 REPLIES 13
lbendlin
Super User
Super User

What are you planning to do with the lists of 3700 integers after you extract them from the binary field? 

Anonymous
Not applicable

Hi @lbendlin , every list of integers will be associated with a unique serial number, so I will need to plot these integers in a line chart and I will need to perform some simple calculations on them like getting the average or standard deviation.

Split your binary by positions, split into rows, interpret the result as integer.

 

Would be good if you could post a couple of samples.

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).

Do not include sensitive information or anything not related to the issue or question.

If you are unsure how to upload data please refer to https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...

Please show the expected outcome based on the sample data you provided.

Want faster answers? https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Anonymous
Not applicable

Here is a link to sample data in pbix file, it has the data along with the expected outcome for one Binary ( I am using serial number for every row to make it more clear) : https://drive.google.com/file/d/1Jz6TfP7tUTYTeVqsTTk3eSIuF_xAg4yG/view?usp=sharing

I didn't split the rows, I only used the following line on the original binary columns since I can't copy them as they are :

Binary.ToText([DATA_ARRAY1], BinaryEncoding.Base64)

If you need me to perform any kind of steps on the binary columns before using the Base64 please let me know.

It says that the encoding is invalid.

 

lbendlin_0-1706413916878.png

The data is cut off at 1024 bytes, maybe that is causing the error.

 

Anyway, since you already have the binary, do the following steps:

 

1. Binary.Split with a page size of 4

2. with the result do Binary.ToList

3. Now you have to check the most significant bit (bit 7 of the first value) - that is your sign, with 1 meaning negative.  All the other bits from the first value and all the bits from the other three values constitute your number.  You can use the Number BitShift functions to add them together.

Here is an example of the mechanics, using the brute force approach rather than two's complement.

 

 

 

 

 

let
  Source = Table.FromRows(
    Json.Document(
      Binary.Decompress(
        Binary.FromText(
          "i45WMjQwVtJRMjKFkKZQMlYnWsnUEoeEhREOCUMDEM8AjsFiFoZAtiGKmJEB2GiEWCwA",
          BinaryEncoding.Base64
        ),
        Compression.Deflate
      )
    ),
    let
      _t = ((type nullable text) meta [Serialized.Text = true])
    in
      type table [Byte3 = _t, Byte2 = _t, Byte1 = _t, Byte0 = _t]
  ),
  #"Changed Type" = Table.TransformColumnTypes(
    Source,
    {{"Byte3", Int16.Type}, {"Byte2", Int16.Type}, {"Byte1", Int16.Type}, {"Byte0", Int16.Type}}
  ),
  BLOB = Binary.Combine(
    Table.AddColumn(#"Changed Type", "Custom", each #binary({[Byte0], [Byte0], [Byte2], [Byte3]}))[
      Custom
    ]
  ),
  Items = Binary.Split(BLOB, 4),
  #"Converted to Table" = Table.FromList(
    Items,
    Splitter.SplitByNothing(),
    null,
    null,
    ExtraValues.Error
  ),
  #"Added Custom1" = Table.AddColumn(
    #"Converted to Table",
    "Result",
    each
      let
        a = Binary.ToList([Column1]),
        b = ((a{0} * 256 + a{1}) * 256 + a{2}) * 256 + a{3}
      in
        if b > 2147483647 then b - Number.Power(256, 4) else b,
    Int32.Type
  )
in
  #"Added Custom1"

 

Anonymous
Not applicable

@lbendlin  I believe I now have a better understanding of the mechanics right now, but could you please explain how you obtained the text below? Specifically, how can I apply the code to my original columns?

 

i45WMjQwVtJRMjKFkKZQMlYnWsnUEoeEhREOCUMDEM8AjsFiFoZAtiGKmJEB2GiEWCwA

 

The dataset I am working with consists of approximately 3 million unique serial numbers, and for each serial number, I have the two arrays (the order of the array is critical, it's a time series). Would this process still be efficient for such a dataset?

That text is just representing the sample data I used

lbendlin_0-1706464892198.png

 

By the way, I was going at this way too cute. There are much simpler ways of achieving your goal

 

 

 

 

 

...
    Items = Binary.Split(BLOB,4),
    #"Converted to Table" = Table.FromList(Items, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Added Custom" = Table.AddColumn(#"Converted to Table", "Result2", each let b=BinaryFormat.Record([val = BinaryFormat.SignedInteger32])in b([Column1])[val],Int32.Type)
in
    #"Added Custom"

 

 

 

 

You can even skip the Table conversion and use List transforms directly at this point. 

 

 

 

...

   Items = List.Transform(Binary.Split(BLOB,4),each BinaryFormat.Record([val = BinaryFormat.SignedInteger32])(_)[val])
in
    Items

 

 

 

 

Next step would be to use List.Zip to do a side merge between the three blobs,  and finally you would convert the list of lists to a table.

 

This is all very low level stuff so it should have a good performance.  Worst case you can use a Binary.Buffer on your blobs.

Anonymous
Not applicable

@lbendlin, this is fantastic! Now, I'm thinking how to get this data in another table with the three lists and their associated Serial Numbers. As I mentioned earlier, each Serial Number comes with its own set of data. For instance, Serial Number 5559 will have three columns corresponding to the three binary columns. Given the expected values I provided in the PBIX file, could you kindly demonstrate how this can be achieved using the sample data? I haven't worked with M code extensively, so while I can follow your instructions, executing the manipulations you mentioned is a bit challenging for me. My goal is to have a separate table for the new columns in a regular format with no lists so I can later filter by serial number, plot the columns and do some calculations. I really appreciate your help.

Please study the following code.  I have converted the expected result into the original binary form and then back. You only need to use the code starting from "START HERE".

 

let
    Source = Json.Document( Text.FromBinary( Binary.Decompress( Binary.FromText( "H4sIAAAAAAAEAJXdTa4dMW5A4b143A3c+lFVKdMsI8gO0p1RRkH2nttAgOSdr2A5Qxum60oUKfKIov7lP3/987//23/87e/br3/69fn1l//50/7901/v+3//4vjHX1zH8eu//vJ/JbafEtezrST2fGNcPyQ++edHPjDGb//5mf/9/Pz2n4/873PPz99nJK5+4KxEB3z/fgQvU/T8lDifKxLbiMTMr7oiMb4/M4qLrq/9Xn1k236vur+O+6kI2u7gt7si1fg1O8P8sGr9PirCD4vm709FbpZ6Vb9V9Z+rIvdK5GT4Uf6z1wbVS7W/VZX8sL2WvrOM94rU1G++0rHs1f4TkTH5YdX+pwtm70reo/3xPMuxVPv71h9Wu9+rfYffNbZX+zfOkbFE+/fEKhGJ9sc9O5bq5aj2dXvVy4H2n36ly/LYK9KVjKs8qv1ZVeIrj2j/Gp3kDyLR/vPhh3XBHNX+hfa7YI76/U9/2IZItX8srfKI9tmAx9MFc1b72MtRVZ71/Eetkkk+q33cOPZyon08f2fsrOc/8JadsbO2P7u7DsZydSzYC2Op7Y+KbDWxs9r/dI1hlWc9/2T4tf3Rff+sKke/MgjyCAu3ilT7H1ZyVTmqfaIehj+qfTc+ho/nJyCpKke1PzExRKp9git/WLV/EcPUkMcq6lMvV21/67IkILlq+1v9mCLVPm4cVV5HFz9OiUi8nv/pjH06Y9dS+zszVs9fVY5ZD3PV8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JJUSL9HhaHm7trz+RCiZX0EVYb2A9Y0uCfcyimbrX6FqEBYdrr+Ci3jCJ4z+Aqxa/xBysqVYR6gAU9+hZa5Bh1kt8+y6vBtypd1h29xBIiSptIv8R61h1KCFyEiy+UTYF8hIktI08uYiCPeTONf/xs+SBut6dkAAA==" ), Compression.GZip ) ) ),
    #"Converted to Table" = Table.FromList(Source, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Expanded Column1" = Table.ExpandRecordColumn(#"Converted to Table", "Column1", {"Column1", "Column2", "Column3"}, {"CFG_FILE", "DATA_ARRAY1", "DATA_ARRAY2"}),
    EXPECTED = Table.TransformColumnTypes(#"Expanded Column1",{{"CFG_FILE", Int32.Type}, {"DATA_ARRAY1", Int32.Type}, {"DATA_ARRAY2", Int32.Type}}),
    #"Added Custom" = Table.AddColumn(EXPECTED, "CFG", each #binary({Number.BitwiseAnd(Number.BitwiseShiftRight([CFG_FILE],24),255),Number.BitwiseAnd(Number.BitwiseShiftRight([CFG_FILE],16),255),Number.BitwiseAnd(Number.BitwiseShiftRight([CFG_FILE],8),255),Number.BitwiseAnd([CFG_FILE],255)})),
    #"Added Custom1" = Table.AddColumn(#"Added Custom", "DATA1", each #binary({Number.BitwiseAnd(Number.BitwiseShiftRight([DATA_ARRAY1],24),255),Number.BitwiseAnd(Number.BitwiseShiftRight([DATA_ARRAY1],16),255),Number.BitwiseAnd(Number.BitwiseShiftRight([DATA_ARRAY1],8),255),Number.BitwiseAnd([DATA_ARRAY1],255)})),
    #"Added Custom2" = Table.AddColumn(#"Added Custom1", "DATA2", each #binary({Number.BitwiseAnd(Number.BitwiseShiftRight([DATA_ARRAY2],24),255),Number.BitwiseAnd(Number.BitwiseShiftRight([DATA_ARRAY2],16),255),Number.BitwiseAnd(Number.BitwiseShiftRight([DATA_ARRAY2],8),255),Number.BitwiseAnd([DATA_ARRAY2],255)})),
    #"START HERE" = #table({"CFG_FILE","DATA_ARRAY1","DATA_ARRAY2"},{{Binary.Combine(#"Added Custom2"[CFG]),Binary.Combine(#"Added Custom2"[DATA1]),Binary.Combine(#"Added Custom2"[DATA2])}}),
    #"Added Custom3" = Table.AddColumn(#"START HERE", "CFG", each List.Transform(Binary.Split([CFG_FILE],4),each BinaryFormat.Record([val = BinaryFormat.SignedInteger32])(_)[val])),
    #"Added Custom4" = Table.AddColumn(#"Added Custom3", "DATA1", each List.Transform(Binary.Split([DATA_ARRAY1],4),each BinaryFormat.Record([val = BinaryFormat.SignedInteger32])(_)[val])),
    #"Added Custom5" = Table.AddColumn(#"Added Custom4", "DATA2", each List.Transform(Binary.Split([DATA_ARRAY2],4),each BinaryFormat.Record([val = BinaryFormat.SignedInteger32])(_)[val])),
    #"Added Custom6" = Table.AddColumn(#"Added Custom5", "Combined", each List.Zip({[CFG],[DATA1],[DATA2]})),
    Combined = #"Added Custom6"{0}[Combined],
    #"Converted to Table1" = Table.FromList(Combined, Splitter.SplitByNothing(), null, null, ExtraValues.Error),
    #"Extracted Values" = Table.TransformColumns(#"Converted to Table1", {"Column1", each Text.Combine(List.Transform(_, Text.From), "|"), type text}),
    #"Split Column by Delimiter" = Table.SplitColumn(#"Extracted Values", "Column1", Splitter.SplitTextByDelimiter("|", QuoteStyle.Csv), {"CFG_FILE", "DATA_ARRAY1", "DATA_ARRAY2"}),
    RESULT = Table.TransformColumnTypes(#"Split Column by Delimiter",{{"CFG_FILE", Int32.Type}, {"DATA_ARRAY1", Int32.Type}, {"DATA_ARRAY2", Int32.Type}})
in
    RESULT
Anonymous
Not applicable

@lbendlinYou're a rockstar, thank you so much.

After checking with the database admin, it turns out that
the data in the BLOBs is LE (little endian). or BE (big endian).So, following your direction, I changed the line ( for all, DATA_ARRAY1,DATA_ARRAY2, CFG_FILE):
 

 

List.Transform(
    Binary.Split([DATA_ARRAY1],4),
    each BinaryFormat.Record([val = BinaryFormat.SignedInteger32])(_)[val])

 

To be:

 

List.Transform(
    Binary.Split([DATA_ARRAY1], 4),
    each BinaryFormat.ByteOrder(
        BinaryFormat.Record([val = BinaryFormat.SignedInteger32]),
        ByteOrder.LittleEndian
    )(_)[val]
)

 


And it's working perfectly now! I can see the correct numbers. But there remain three issues:

1) It's essential to identify to which serial number does the array belong so I need the serial number to be in the result (the seconds will be nice to have, it will reset to 0 for every new serial number):

sarah931_0-1706552294398.png

 


2) I am not sure what's the best way to store the data becuase considering that I have around 3 millions unique serial numbers, each with 3 arrays with 1000 rows each, this could reach a billion data point if I follow the structure in the above image. ( I can ask this question in another post if that's better)

3) I also noticed that the code returns 3700 elements but I was expecting only 1087 elements (rows). So I asked him about this and he said that the 3700 is the the maximum elements of the array. There is DATA_POINTS column in the database that tells =exactly how many elements of data are stored in each array for DATA_ARRAY1 and DATA_ARRAY2 for every serial number.  So for the sample serial number we have, the number of data points is 1087. How can I incorporate this in the code?

1. just add the serial number as a column before you transform the blobs - it will automatically be expanded with the other columns.

2. as long as you keep the table narrow Power BI has no issues with billions of rows. If you want to be cute you can consider incremental refresh.

3. That was not part of the sample data - But what you can do is cut the BLOBs  into chunks of 4xDATA_POINTS first and then take the first list item for each serial number, and process that.

Anonymous
Not applicable

Thanks @lbendlin, here is the revised code where I also added an index column (Seconds) that resets with every new serial number:

 

let
 Source =....,
 GSDATA = .......,
 Table1 = .........,
 #"Kept First Rows" = Table.FirstN(Table1, 10),
 #"Removed Other Columns" = Table.SelectColumns(
   #"Kept First Rows",
   {"SERIAL_NUM", "TEST_DATE", "DATA_ARRAY1", "DATA_ARRAY2", "CFG_FILE", "DATA_POINTS"}
 ),
 #"Added Custom3" = Table.AddColumn(
   #"Removed Other Columns",
   "ALL",
   each Table.AddIndexColumn(
     Table.Combine(
       List.Transform(
         List.Zip(
           {
             List.FirstN(
               List.Transform(
                 Binary.Split([CFG_FILE], 4),
                 each BinaryFormat.ByteOrder(
                   BinaryFormat.Record([val = BinaryFormat.SignedInteger32]),
                   ByteOrder.LittleEndian
                 )(_)[val]
               ),
               [DATA_POINTS]
             ),
             List.FirstN(
               List.Transform(
                 Binary.Split([DATA_ARRAY1], 4),
                 each BinaryFormat.ByteOrder(
                   BinaryFormat.Record([val = BinaryFormat.SignedInteger32]),
                   ByteOrder.LittleEndian
                 )(_)[val]
               ),
               [DATA_POINTS]
             ),
             List.FirstN(
               List.Transform(
                 Binary.Split([DATA_ARRAY2], 4),
                 each BinaryFormat.ByteOrder(
                   BinaryFormat.Record([val = BinaryFormat.SignedInteger32]),
                   ByteOrder.LittleEndian
                 )(_)[val]
               ),
               [DATA_POINTS]
             )
           }
         ),
         (x) => Table.FromRows({x}, {"CFG", "DATA1", "DATA2"})
       )
     ),
     "Secondes",
     0,
     1
   )
 ),
    #"Expanded ALL" = Table.ExpandTableColumn(#"Added Custom3", "ALL", {"CFG", "DATA1", "DATA2", "Secondes"}, {"CFG", "DATA1", "DATA2", "Secondes"})
in
    #"Expanded ALL"

 

Result:

sarah931_0-1707075211367.png

 



Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors