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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Push dataset to power bi premium workspace using xmla endpoints

I need to read dataset (.json file) from a specified location (c:\testing\datset.json) and push the dataset to Power BI premium workspace.  

How to programatically read the json file content and push the dataset to power bi workspace using XMLA endpoints?

@lbendlin 

 

 

 

1 ACCEPTED SOLUTION
4 REPLIES 4
v-shex-msft
Community Support
Community Support

Hi @Anonymous,

Did lbendlin 's suggestions help with your scenario? if that is the case, you can consider Kudo or accept the helpful suggestions to help others who faced similar requirements.

If these also don't help, please share more detailed information to help us clarify your scenario to test.

How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

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

@lbendlin Is there c# example to perform the same?

lbendlin
Super User
Super User

"push the dataset to power bi workspace using XMLA endpoints"

 

That's not how push datasets work (yet). You need to use the push URL and put your data payload into the POST body.  Here's an example with Powershell.  Replace the body construct with the contents of your JSON file.

 

#capture stats
$date = (Get-Date).ToUniversalTime().ToString('yyyy-MM-ddTHH:mm:00.000Z')
$mem = (Get-Counter '\Memory\Available MBytes').CounterSamples.CookedValue
$proc = (Get-Counter '\Processor(_Total)\% Processor Time').CounterSamples.CookedValue
$disk = (Get-Counter '\LogicalDisk(C:)\% free space').CounterSamples.CookedValue
$svg = "data&colon;image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg'><text font-size='12px' font-family='sans-serif' transform='translate(12, 75) rotate(270)'>" + $env:computername + "</text></svg>"
#enforce TLS1.2
[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12
$payload = @{
"Host" = $env:computername
"Timestamp" = $date
"Available Memory in MB" = $mem
"Processor Load %" = $proc
"% Free on C:" = $disk
"img" = $svg
}
#push URL
$endpoint = "https://api.powerbi.com/beta/<tenant>/datasets/<dataset>/rows?key=<push key>"
Invoke-RestMethod -Method Post -Uri "$endpoint" -Body $payload

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.