cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
purnima13
Helper I
Helper I

Azure Blob read with encoding utf-8

Hello,
I have a list of csv files in azure blob that I combine and import into power BI.
I am successfully able to import the files.

But, the files in the blob are encoded in utf-8 and I would like to know how to enforce this encoding while reading the files from the azure blob (or) enable encoding for certain column after importing the files.

 

Below is the code from advanced editor

let
    Source = AzureStorage.Blobs("https://xxx.blob.core.windows.net/"),
    #"xxx" = Source{[Name="xxx"]}[Data],
    #"Filtered Rows" = Table.SelectRows(#"xxx", each Text.StartsWith([Name], "2019_")),
    #"Filtered Hidden Files1" = Table.SelectRows(#"Filtered Rows", each [Attributes]?[Hidden]? <> true),
    #"Invoke Custom Function1" = Table.AddColumn(#"Filtered Hidden Files1", "Transform File from xxx", each #"Transform File from xxx"([Content])),
    #"Renamed Columns1" = Table.RenameColumns(#"Invoke Custom Function1", {"Name", "Source.Name"}),
    #"Removed Other Columns1" = Table.SelectColumns(#"Renamed Columns1", {"Source.Name", "Transform File from xxx"}),
    #"Expanded Table Column1" = Table.ExpandTableColumn(#"Removed Other Columns1", "Transform File from xxx", Table.ColumnNames(#"Transform File from xxx"(#"Sample File")))
in
    #"Expanded Table Column1"

Thank you

1 ACCEPTED SOLUTION
purnima13
Helper I
Helper I

This is what finally worked for me.
I just combined the binary files in this way.
When you click on the downward arrow in content to combine the files. It takes a sample file and asks us to choose the encoding.
This made it easier and the output is correctly encoded with utf8

combine files from the content columncombine files from the content column

View solution in original post

2 REPLIES 2
purnima13
Helper I
Helper I

This is what finally worked for me.
I just combined the binary files in this way.
When you click on the downward arrow in content to combine the files. It takes a sample file and asks us to choose the encoding.
This made it easier and the output is correctly encoded with utf8

combine files from the content columncombine files from the content column

v-yuta-msft
Community Support
Community Support

@purnima13 ,

 

You can add a step using Text.FromBinary function.

 

Text.FromBinary(binary as nullable binary, optional encoding as nullable number) as nullable text

 

Community Support Team _ Jimmy Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Release May 2022 768x460.png

Check it out!

Click here to read more about the May 2022 updates!