Last week, while working on Power BI, I received a request to convert Base64 to a PDF file. The requirement was to decode a text file containing a PDF encoded in Base64 format and display that PDF within Power BI.
In this Power BI tutorial, I will explain how to convert Base64 to PDF using Power BI.
Convert Base64 to PDF Using Power BI
Here is the text file, which is encoded in base64 format. Check the screenshot below.

Now follow the below steps:
Import Text file into Power BI
1. Copy all the base64 text and paste it into a new Excel workbook.

You might think we can directly import the text file into Power BI, but when you import the text file, some characters might not import correctly.
2. Copy the base64 in Excel sheet 1 and add a new sheet in the new sheet peste in Transpose, like the screenshot below.

3. Now, we give the column a name. When you copy and paste the text into the Excel file, it is stored in 21 rows, although this may vary depending on your PDF.
Here, I gave the column names from A1 to A21 and changed the sheet name to ‘base64,’ as shown in the screenshot below. After that, save and close the Excel file.

4. Now open Power BI Desktop and get that Excel file. Select the base64 sheet, then click on Transform Data.

5. The Power Query Editor will open here under the Transform tab. Click Use First Row as Headers.

6. Under the File tab, click Close & Apply.

Combine all the Column using Power BI DAX
You can see the column in the Date pane. Now, we create a new column combining all columns using the Dax expression below.
PDF = [A1] & [A2] & [A3] & [A4] & [A5] & [A6] & [A7] & [A8] & [A9] & [A10] & [A11] & [A12] & [A13] & [A14] & [A15] & [A16] & [A17] & [A18] & [A19] & [A20] & [A21]
Add PDF Viewer in Power BI Desktop
We have now added a PDF viewer to Power BI. To do this, click Get more visuals under the Visual gallery.
Before that, log in to Power BI Desktop with your school or organization account.

In the Search bar, search for a PDF viewer and select the PDF viewer shown in the screenshot below.

Add the Pdf Viewer to the Power BI Desktop.

You can see a pop-up message that you successfully imported.

Then, add the Pdf Viewer and the PDF column to the PDF Base64 Data.

After that, you can see the PDF in the Pdf Viewer.

I hope you follow all the steps to convert base64 to PDF using Power BI Desktop. Feel free to comment if you have any doubts or questions about this topic or related topics.
You may also like to read:
- Show Percentage in a Power BI Bar Chart Data Label
- Power BI Scheduled Refresh
- Export Power BI Reports to PDF

After working for more than 18 years in Microsoft technologies like SharePoint, Microsoft 365, and Power Platform (Power Apps, Power Automate, and Power BI), I thought will share my SharePoint expertise knowledge with the world. Our audiences are from the United States, Canada, the United Kingdom, Australia, New Zealand, etc. For my expertise knowledge and SharePoint tutorials, Microsoft has been awarded a Microsoft SharePoint MVP (12 times). I have also worked in companies like HP, TCS, KPIT, etc.