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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
SRJPBI
Frequent Visitor

Why is the Power BI REST API saving a query result as a string?

I have a Power BI report that's been published into the online service. It works fine. I now want to automatically extract data from a matrix within the report. The matrix looks like this:

 

CampaignMailedOpened
AAA238096118801
BBB19851998489
CCC195848100218
Total632463317508

 

I've set up a flow in Power Automate using the Power BI REST API to run the query. The flow looks like this:

  1. Run a query against a dataset
  2. Launch Excel
  3. Write to Excel worksheet
  4. Save Excel

The flow runs successfully, but when I open the resulting spreadsheet it just contains this string in cell A1:

 

{"results":[{"tables":[{"rows":[{"Table[Campaign]":"AAA","[SumMailed]":238096.0,"[SumOpened]":118801.0},{"Table[Campaign]":"BBB","[SumMailed]":198519.0,"[SumOpened]":98489.0},{"Table[Campaign]":"CCC","[SumMailed]":195848.0,"[SumOpened]":100218.0}]}]}],"firstTableRows":[{"Table[Campaign]":"AAA","[SumMailed]":238096.0,"[SumOpened]":118801.0},{"Table[Campaign]":"BBB","[SumMailed]":198519.0,"[SumOpened]":98489.0},{"Table[Campaign]":"CCC","[SumMailed]":195848.0,"[SumOpened]":100218.0}]}

 

Does anyone know how I can have the query results save into a spreadsheet in tabular format please? 

 

If it helps, here is my DAX:

 

EVALUATE
TOPN(501, SUMMARIZECOLUMNS(
'Table'[Campaign],
"SumMailed", CALCULATE(SUM('Table'[Mailed])),
"SumOpened", CALCULATE(SUM('Table'[Opened]))
), 'Table'[Campaign], 1)

ORDER BY
'Table'[Campaign]

4 REPLIES 4
DataTako
Helper I
Helper I

As far as I know, "Show data point as a table" isn't available for all visuals in the Power BI Service, even though it is in Power BI Desktop. The Desktop and Service don't always offer the same context menu options, especially for map visuals.

 

Since you mentioned this used to work for the same report, I'd first check whether anything has changed recently, such as the visual type, tenant settings, or a recent Power BI Service update. If nothing has changed on your end, it could also be a regression in the Service.

 

As a workaround, you could use Drillthrough, a report page tooltip, or a table visual that responds to the map selection, depending on the experience you're trying to provide.

 

I'd be interested to hear if others can still reproduce this in the current version of the Power BI Service.

v-achippa
Community Support
Community Support

Hi @SRJPBI,

 

Thank you for reaching out to Microsoft Fabric Community.

 

Here looks like this is expected, the "Run a query against a dataset" action returns its result in JSON format, not as a table. Since your flow writes the raw response directly to excel, the entire JSON is being stored as a single string in cell A1.

  • To get the data in tabular format, add a Parse JSON action after Run a query against a dataset and extract the rows first and then write those rows to excel, instead of writing the raw response directly. Once the rows are parsed and mapped to columns, the data will save in proper tabular format.

For reference, please follow the below documentation:

Datasets - Execute Queries - REST API (Power BI Power BI REST APIs) | Microsoft Learn

 

Thanks and regards,

Anjan Kumar Chippa

@v-achippa Thanks for the explanation; that makes sense. However, I am using Power Automate Desktop, which I don't believe has the function Parse JSON. Is there a way to do this in the Desktop version please?

Hi @SRJPBI,

 

Thank you for the response and confirming that you are using power automate desktop.

  • After Run a query against a dataset, add Convert JSON to custom object action to convert the API response into a custom object. After that you can access the returned data, loop through the firstTableRows and write each record to excel instead of writing the raw json response.

For reference, follow the below documentation:

Variables actions reference - Power Automate | Microsoft Learn

 

Thanks and regards,

Anjan Kumar Chippa

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.