web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Power Platform Community / Forums / Power Automate / run a query against a ...
Power Automate
Answered

run a query against a dataset empty body

(0) ShareShare
ReportReport
Posted on by 29

I'm banging my head against the wall with this issue hoping someone can point out a simple step that I've missed.  Essentially I've been trying to use run a query against a powerbi dataset in power automate to get data from a powerbi report in to power automate.  The instructions I'm finding all seem simple enough and I've followed them to the letter but my query is returning no results in the body, regardless of the report.

The steps I've taken here:

- connected to powerbi inside of the powerautomate

- copied the DAX query from PBI Desktop performance analyzer in to the query box of the power automate step

- tried to create a simple html table from the results. 

When I run, I see that the body results are empty despite my powerbi dataset and DAX table containing data.

 

Any help would be huge!  Thank you!!

 

2023-12-25 - 08-18-03 - Microsoft Power Automate.png

 

 

My DAX query

 

 

// DAX Query
DEFINE
 VAR __DS0Core = 
 SUMMARIZECOLUMNS(
 ROLLUPADDISSUBTOTAL('Table'[Column2], "IsGrandTotalRowTotal"),
 "SumColumn1", CALCULATE(SUM('Table'[Column1]))
 )

 VAR __DS0PrimaryWindowed = 
 TOPN(502, __DS0Core, [IsGrandTotalRowTotal], 0, 'Table'[Column2], 1)

EVALUATE
 __DS0PrimaryWindowed

ORDER BY
 [IsGrandTotalRowTotal] DESC, 'Table'[Column2]

 

 

 

Categories:
I have the same question (0)
  • lbendlin Profile Picture
    8,479 Super User 2025 Season 2 on at

    That query has an unnecessary totals row. Try this query instead:

    EVALUATE SUMMARIZECOLUMNS(
     'Table'[Column2],
     "SumColumn1", CALCULATE(SUM('Table'[Column1]))
     )

     

  • jgabrielson Profile Picture
    29 on at

    That worked!  Thank you. It seems that the DAX interpreter in powerautomate is too basic for advanced DAX queries.  I've tested some this morning and you basically need to boil down the DAX query to a basic EVALUATE statement.  remove the VAR declarations, filters, and orderby and that seems to work.  Does that sound right?  It would be nice if we could at least incorporate filters but I'm not 100% certain that we can't..  Does that sound right?

     

    Thank you very much for your help!!

  • jgabrielson Profile Picture
    29 on at

    scratch that.. it seems just the VARs need to be removed.  Everything needs to be incorporated into one EVALUATE statement... or at least that's what I'm seeing.

  • Verified answer
    lbendlin Profile Picture
    8,479 Super User 2025 Season 2 on at

    I don't think Power Automate knows anything about DAX. It merely hands over the query text to the dataset semantic model and wants a table back.  You can structure the DAX any way you want - which means stripping out unnecessary totals , mostly. 

     

    Remember that ominous "First Table Rows".  Means that while you can have multiple EVALUATE in your DAX, only the first one will actually be used.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Forum hierarchy changes are complete!

In our never-ending quest to improve we are simplifying the forum hierarchy…

Ajay Kumar Gannamaneni – Community Spotlight

We are honored to recognize Ajay Kumar Gannamaneni as our Community Spotlight for December…

Leaderboard > Power Automate

#1
Michael E. Gernaey Profile Picture

Michael E. Gernaey 525 Super User 2025 Season 2

#2
Tomac Profile Picture

Tomac 324 Moderator

#3
abm abm Profile Picture

abm abm 232 Most Valuable Professional

Last 30 days Overall leaderboard