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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
jtooke
Helper I
Helper I

Use Power Automate to extract filtered data to Excel

Hello,

I am looking to use Power Automate to allow a user to extract data from a Power BI report to Excel. The data should include any on-screen slicer selections. Due to the data size, I have been looking at doing this through the Power Automate "query a dataset", but I am unable to get the query correct to update dynamically based on filtered selections.

 

I have included a sample screeshot with the page I am looking to extract data from. The slicers pull from the RR table which is related to Table. The columns that will be extracted come from Table.

jtooke_0-1768591566427.png

 

Table

IDOverall InherentA InherentB InherentOverall ResidualA ResidualB Residual

1HighMediumLowLowLowLow
2MediumMediumLowMediumMediumLow
3MediumMediumLowLowLowLow
4MediumMediumLowLowLowLow
5HighMediumLowLowLowLow

RR

IDGroupRating TypeRating

1OverallInherentHigh
1OverallResidualLow
1AInherentMedium
1AResidualLow
1BInherentLow
1BResidualLow
2OverallInherentMedium
2OverallResidualMedium
2AInherentMedium
2AResidualMedium
2BInherentLow
2BResidualLow
3OverallInherentMedium
3OverallResidualLow
3AInherentMedium
3AResidualLow
3BInherentLow
3BResidualLow
4OverallInherentMedium
4OverallResidualLow
4AInherentMedium
4AResidualLow
4BInherentLow
4BResidualLow
5OverallInherentHigh
5OverallResidualLow
5AInherentMedium
5AResidualLow
5BInherentLow
5BResidualLow

Any help is appreciated, thank you!

1 ACCEPTED SOLUTION
tharunkumarRTK
Super User
Super User

@jtooke 

When you are creating a power automate flow for this use case, do not create a flow in power automate portal, instead create in power bi desktop. Otherwise, your flow might not be able to capture the selections in the power bi slicer. 

 

To prepare the dax query easily, I would suggest you to create a table visual in your report and make sure unwanted columns are removed, columns are renamed appropriately  and totals are disabled from the visual.

 

Place the slicer and select one or two values, Then from the performance analyzer you will be able to capture the visual dax query. 

 

You can use the same in your power qutomate flow. This is not completed yet, as the slicer selections would be hardcoded, you can identify the section where the hardcoded values are present in the dax query and replave them with the values capture by the flow. 

 

Note: if it is only one value then you can directly replace the value with the captured value, if there are multiple values selected in the slicer then you might need to use join/concatenate function in power automate to concatenate all the values delimted by a comma

here is a detailed article: https://powerbi.microsoft.com/en-us/blog/unlocking-new-self-service-bi-scenarios-with-executequeries...

 

 

 

 

Connect on LinkedIn

read my blogs here: techietips.co.in

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

View solution in original post

5 REPLIES 5
tharunkumarRTK
Super User
Super User

@jtooke 

When you are creating a power automate flow for this use case, do not create a flow in power automate portal, instead create in power bi desktop. Otherwise, your flow might not be able to capture the selections in the power bi slicer. 

 

To prepare the dax query easily, I would suggest you to create a table visual in your report and make sure unwanted columns are removed, columns are renamed appropriately  and totals are disabled from the visual.

 

Place the slicer and select one or two values, Then from the performance analyzer you will be able to capture the visual dax query. 

 

You can use the same in your power qutomate flow. This is not completed yet, as the slicer selections would be hardcoded, you can identify the section where the hardcoded values are present in the dax query and replave them with the values capture by the flow. 

 

Note: if it is only one value then you can directly replace the value with the captured value, if there are multiple values selected in the slicer then you might need to use join/concatenate function in power automate to concatenate all the values delimted by a comma

here is a detailed article: https://powerbi.microsoft.com/en-us/blog/unlocking-new-self-service-bi-scenarios-with-executequeries...

 

 

 

 

Connect on LinkedIn

read my blogs here: techietips.co.in

 

 








Did I answer your question? Mark my post as a solution!
If I helped you, click on the Thumbs Up to give Kudos.

Proud to be a Super User!


PBI_SuperUser_Rank@2x.png

Otherwise, your flow might not be able to capture the selections in the power bi slicer. 

The Power Automate visual has its own value columns. It will only be impacted by slicers if the data model has the neessary joins.

 

If you lose the trigger payload in the flow you need to do is reassign the array in the trigger options.

cengizhanarslan
Super User
Super User

1) Capture slicer selections as values in the flow

In Power Automate, the easiest way is to use the Power BI button visual (or the Power Automate visual) and pass the slicer fields as inputs.

You want to pass the selected values for:

  • RR[Group]

  • RR[Rating Type]

  • RR[Rating]

If multi-select is allowed, pass them as arrays/strings you can split.

 

2) Use a DAX query with TREATAS to apply those slicer selections

Because your slicers are on RR but you’re extracting columns from Table, you should filter RR first, then let the relationship filter Table via ID.

Example DAX query (single-select version):

DEFINE
    VAR vGroup      = @GroUp
    VAR vRatingType = @RatingType
    VAR vRating     = @Rating

    VAR FilterRR =
        CALCULATETABLE (
            VALUES ( RR[ID] ),
            TREATAS ( { vGroup }, RR[Group] ),
            TREATAS ( { vRatingType }, RR[Rating Type] ),
            TREATAS ( { vRating }, RR[Rating] )
        )

EVALUATE
    CALCULATETABLE (
        SELECTCOLUMNS (
            'Table',
            "ID", 'Table'[ID],
            "Overall Inherent", 'Table'[Overall Inherent],
            "A Inherent", 'Table'[A Inherent],
            "B Inherent", 'Table'[B Inherent],
            "Overall Residual", 'Table'[Overall Residual],
            "A Residual", 'Table'[A Residual],
            "B Residual", 'Table'[B Residual]
        ),
        TREATAS ( FilterRR, 'Table'[ID] )
    )

 

_________________________________________________________
If this helped, ✓ Mark as Solution | Kudos appreciated
Connect on LinkedIn | Follow on Medium
AI-assisted tools are used solely for wording support. All conclusions are independently reviewed.
lbendlin
Super User
Super User

Consider using the Power Automate visual in Power BI. It can be subjected to the same filters as the other visuals.

hnguy71
Super User
Super User

Hi @jtooke 

 

Using Power Automate to Execute a DAX query requires a valid query to be sent. It will execute against your model based on the query execution parameters.

 

For example:

EVALUATE RR


This would return an output of your 'RR' table. The problem with your approach is that on Power BI service, you cannot send the result of a visual calculation to Power Automate. 

 

Instead, you have a few other approaches that would work. On the top of my head, two comes to mind:

 

1. Embed PowerApps into your model. This will pull the data directly from your model along with any filters your user has selected. From there, you can create an export button which would save the current table or gallery result and you can ask it to generate an excel file and have it sent to their email or your desired location.

2.  Give them the ability to connect to your model by live connecting to your model via Excel. With this, they can explore the data as they see fit.



Did I answer your question?
Please help by clicking the thumbs up button and mark my post as a solution!

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

Check out the May 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.