Skip to main content

Notifications

Community site session details

Community site session details

Session Id : 1Ob4k4XsuUJ01prEBXtiv3
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

Understanding Microsoft Agents - Introductory Session

Confused about how agents work across the Microsoft ecosystem? Register today!

Markus Franz – Community Spotlight

We are honored to recognize Markus Franz as our April 2025 Community…

Kudos to the March Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard

#1
WarrenBelz Profile Picture

WarrenBelz 146,668 Most Valuable Professional

#2
RandyHayes Profile Picture

RandyHayes 76,287 Super User 2024 Season 1

#3
Pstork1 Profile Picture

Pstork1 66,004 Most Valuable Professional

Leaderboard
Loading started