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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
kb177
Helper II
Helper II

Export filtered matrix to Excel using Power automate

Hi,

 

I have 3 matrix tables in seperate pages on my report, I'm looking out to export the same to excel into one workbook into seperate sheets

 

I dont have access to power apps, only power automate is available

 

I've tried export to csv each file  but I'm not getting any flow to merge all 3 files  into .xlsx workbook  into seperate sheets 

my data is being saved into onedrive but I'm unable to see the files directly, I'm creating a dummy note pad file or folder etc and deleting it then only those csv files are showing up 

 

1 ACCEPTED SOLUTION
ImkeF
Super User
Super User

Oh I see: You have entered the formula into the wrong window. That will indeed just interpret it as text.
Instead, click on "Add dynamic content" and then choose the "Expression"-window for the formula.

ImkeF_0-1665556043006.png

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

7 REPLIES 7
ImkeF
Super User
Super User

Oh I see: You have entered the formula into the wrong window. That will indeed just interpret it as text.
Instead, click on "Add dynamic content" and then choose the "Expression"-window for the formula.

ImkeF_0-1665556043006.png

 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Thanks for the correction, I have added all the steps as per the video till add a row to table but not sure why data is not getting added just table is expanding 

kb177_0-1665559990171.png

 

ImkeF
Super User
Super User

Hi @kb177 ,
to make using the result of the query against your dataset as easy as possible I'd recommend to transform the matrix visual into a table visual instead. This ensures that only one table is returned by the DAX-query and you then therefore reference it unambigously.
In your flow, you create a compose action and use this formula in it:

outputs('Run_a_query_against_a_dataset')?['body/results'][0]['tables'][0]['rows']
 
This will return an array. Based on this, you can follow the instructions in this video to: Power Automate Export to Excel | Dynamically create Table, Columns & Add Rows to Excel | Send Email ...

1) Create an Excel file
2) Create a table in that Excel file
3) Fill in the rows from your array into this table

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

Should I add run a query against data set and then compose flow ?

 

if that's the case then compose action is just returning the formula as text in  output 

kb177_0-1665554948372.png

 

ImkeF
Super User
Super User

Hi @kb177 ,
You can use the "Run a query against a dataset"-action to fetch the data from Power BI.
You can retrieve the query code by turning on the performance analyzer, start recording and refresh the matrix visuals. Then copy the query and use it in the Power Automate action. 

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

I want to export to excel not to csv, After pasting the query in the below flow what should be done next

 

I dont want to create csv table and create a file from that 

kb177_0-1665465779206.png

 

From there you can try converting CSVs to Excel with something like this template:

https://powerusers.microsoft.com/t5/Power-Automate-Cookbook/CSV-To-New-Excel-Table/td-p/1826096

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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