Skip to main content

Notifications

Community site session details

Community site session details

Session Id : dYk1ufJ0hsgtZHN6oiApRU
Power Automate - General Discussion
Answered

Count the number of rows/records from a Power BI dataset

Like (0) ShareShare
ReportReport
Posted on 24 Sep 2022 02:04:35 by 19

I have a Power Automate workflow that runs a DAX query against a Power BI dataset. How can I count the number of records returned by the query and store this value as a variable to use for conditional logic in the rest of the workflow.

  • Verified answer
    gmorissette Profile Picture
    19 on 24 Sep 2022 at 09:25:37
    Re: Count the number of rows/records from a Power BI dataset

    Thanks for the answer but your solution works for an array. A DAX query returns a table, which is an object. In the end, all you have to do it seems is wrap the object inside the length function like so:

     

    length(outputs('NameOfYourDAXQuery')?['body/firstTableRows'])
  • Sundeep_Malik Profile Picture
    6,480 on 24 Sep 2022 at 04:19:50
    Re: Count the number of rows/records from a Power BI dataset

    Hey @gmorissette 

    Just use length function ahead where ever you are getting the body of the above dataset.

    So for example, after getting the dataset you are saving it in a compose so just write:

    length(outputs('Compose'))

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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Warren Belz – Community Spotlight

We are honored to recognize Warren Belz as our May 2025 Community…

Congratulations to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Power Automate - General Discussion

#1
Pstork1 Profile Picture

Pstork1 20 Most Valuable Professional

#2
rpersad Profile Picture

rpersad 16

#3
Gprior Profile Picture

Gprior 15

Overall leaderboard
Loading started