Forum Discussion

tsimpkins's avatar
tsimpkins
Frequent Visitor
1 year ago
Solved

Power Query Matrix As Power Automate HTML Table

Hi,

 

I have created a Power Automate Flow that uses a Power Query to Get the data set from a Matrix visual in a Power Bi report. It then takes the data set and creates an HTML Table. The issue I have is I need to fully expand all 3 of the nested groupings for all data in the Matrix through the query. Currently it seems it nees to be manually done on the Matrix visual in the Power Bi report and so sometimes, when new non-expanded main groups are added to the data set, the data will come in unexpanded for certain groups.

 

Grouping AGrouping BGrouping CSummary 1Summary 2
Group 1Group 1.A Group 1.A.150100
Group 1Group 1.A Group 1.A.275150
Group 1Group 1.AGroup 1.A125250
Group 1Group 1.BGroup 1.B.1275300
Group 1Group 1.BGroup 1.B275300
Group 1Group 1Group 1400550
Group 2Group 2Group 2500300
Group 3Group 3.AGroup 3.A.1100150
Group 3Group 3.AGroup 3.A100150
Group 3Group 3.BGroup 3.B.1200200
Group 3Group 3.BGroup 3.B200200
Group 3Group 3Group 3300350

 

Group 2 has records in the other Groupings if they have a summary number but those records aren't coming through in the data set, only the Summary/Top Level row of that grouping. Is there a way I can default the Matrix to having all levels/groups expanded/open regardless of the data being presented?

 

  • Hi tsimpkins,

    We sincerely appreciate your inquiry on the Microsoft Fabric Community Forum.

    To expand all levels in the Matrix visual within Power BI Desktop, right-click on any row header and select Expand all. Once you have done this, saving and publishing the report should retain the expanded state.

    If you find our response helpful, we kindly request you to mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

    Thank you.

4 Replies

  • v-pnaroju-msft's avatar
    v-pnaroju-msft
    Icon for Community Support rankCommunity Support

    Hi tsimpkins,

    We sincerely appreciate your inquiry on the Microsoft Fabric Community Forum.

    To expand all levels in the Matrix visual within Power BI Desktop, right-click on any row header and select Expand all. Once you have done this, saving and publishing the report should retain the expanded state.

    If you find our response helpful, we kindly request you to mark it as the accepted solution and provide kudos. This will assist other community members facing similar queries.

    Thank you.

  • 1. "Borrow"  the query from the matrix visual (for example via Performance Analyzer or the Excel "live connection")

    2. clean the query up (for example in DAX Studio, or in the DAX Query view). Think hard, think twice if you really really want these rollups.

    3. Run the query in your flow. Make sure to include nulls (important!)

    4. convert the "First Table Rows"  output to a HTML table

    5. include that table in your email body.

    • tsimpkins's avatar
      tsimpkins
      Frequent Visitor

      Those steps are exactly what I did in PA to make the table. Part of the problem was though that the matrix I borrowed the query from wouldn't be totally expanded so some groups would come into the PA without the sub-groupings of some groups. The "Expand All" looks to be the best solution for this issue.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi tsimpkins 

    May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.

    Thank you.