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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.

Reply
anonymous2
Helper II
Helper II

How to load an excel file to Power BI using Powershell?

Hi, I need to load an excel file to Power BI using Powershell and then get data also using Powershell. Then use them to create a relationship. Does anyone know how to do it?

Thank you in advanced.

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @anonymous2,

AFAIK, the current power bi desktop does not support directly invoking PowerShell to get data.

In my opinion, I'd like to suggest you directly use the power bi desktop client 'get data' functions to get data from an excel sheet or try to use power query with integrated R/Python scripts and packages to interact with PowerShell.

Use R in Power Query Editor - Power BI | Microsoft Docs

Using Python in Power BI Power Query Editor - Power BI | Microsoft Docs

Perhaps you can take a look at the following link with similar requirements if help:

Solved: Power BI Get Data using Powershell - Microsoft Power BI Community

BTW, if you mean to use Powershell with rest API to push dataset to power bi service, that is possible. (power bi service has disabled these types of edit features so you can change relationships)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Hi @v-shex-msft, thank you for your suggestions. I already imported an excel file in Power BI service then I want to create a relationship using rest API post method in Powershell using the data in the excel. But it didn't work. May I know is there a way of doing it? Are relationships can only be seen on Power Bi Desktop?

'BTW, if you mean to use Powershell with rest API to push dataset to power bi service, that is possible. (power bi service has disabled these types of edit features so you can change relationships)'

Yes, I managed to push dataset to power bi service and create relationship using PowerShell. My current problem is, using imported file(excel) to create relationship in powershell. Do you know how to do it?

Thank you.

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel1

Power BI Monthly Update - May 2024

Check out the May 2024 Power BI update to learn about new features.

Top Solution Authors