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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Notialves
Regular Visitor

A question about using the action run a query against a dataset

Hello,

 

I don't know if my question goes here or in Power Automate's forum because I have a dataset with user data from an app that I am trying to leverage in Power Automate using the action "run a query against a dataset" where DAX can be used to bring data from the dataset.

 

The dataset has a column "number of hours" and a measure "Total number of hours", which I am trying to filter by status ("Completed", "Under Review", "not submitted") and by each user using said action from Power Automate.

 

What I am trying to accomplish is to get a JSON using the query where I get the name of each user and their total hours filtered by "not submitted" and by the other two statuses.

 

My first question is: Can it be done?

If my first question is positive, can someone give me some pointers on how can I accomplish that?

 

Thanks for your help.

1 ACCEPTED SOLUTION
johnt75
Super User
Super User

The easiest way do it would be to create a table visual in Power BI which shows the data as you want it, including applying any filters to it. Then use Performance Analyzer to get the DAX code generated for that table. You can examine it in DAX Studio to make sure that is is doing what you want and returning the right results, then you can use the entire query, including the DEFINE clause, in Power Automate.

View solution in original post

3 REPLIES 3
johnt75
Super User
Super User

The easiest way do it would be to create a table visual in Power BI which shows the data as you want it, including applying any filters to it. Then use Performance Analyzer to get the DAX code generated for that table. You can examine it in DAX Studio to make sure that is is doing what you want and returning the right results, then you can use the entire query, including the DEFINE clause, in Power Automate.

Is there a way to use measures? i can run this process well for most of my flows but one datsource has a built in measure which is causing me issues.

If I understand correctly you want to use a query to return the result of a measure. A query has to return a table, but you can wrap the measure inside the table constructor, e.g.

EVALUATE { [My measure] }

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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