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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
kassymov_su
Frequent Visitor

Add rows

Hi All,

 

What is the fastest way to add rows in power query if?

 

In example below I added manually only three rows for each group just to demonstrate what I want, but in fact I have many gorups. Moreover, when add row I need to sum the column [Volums] for each group.

 

I know one way to do that, and it is by using Table.insertRows but then I need to mention exact row and it takes a lot of time still

 

Снимок.PNG

2 REPLIES 2
v-jingzhang
Community Support
Community Support

Hi @kassymov_su 

 

I agree with @BA_Pete. In Power Query, the data table is expected to be a flat table. It cannot do something like merging cells in Excel. As what you want is sub totals of groups, if you want to display this output in Power BI report, you can use Matrix visual to do that. Put both Area code and Activities columns in Rows fields, then expand them. You will have sub total rows there. 

Create a matrix visual in Power BI - Power BI | Microsoft Docs

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

BA_Pete
Super User
Super User

Hi @kassymov_su ,

 

This should absolutely not be done in Power Query.

The correct way to do what you want would be to create a dimension table that contains unique [Code for Area] values with your desired descriptions in another column, something like this:

 

|  Code for Area  |  descForArea                  |
|  Civil-A1       |  Civil Works at Area A1       |
|  Electrocal-A1  |  Electrical Works at Area A1  |
|  ...

 

 

You would then relate dimension[Code for Area] ONE : MANY fact[Code for Area] and use dimension[descForArea] in a matrix visual as the Rows value.

There's a few other settings that you can adjust to get exactly the look that you want, such as Stepped Layout and Stepped Indentation, but this is the basic setup that you need to work toward.

 

Pete



Now accepting Kudos! If my post helped you, why not give it a thumbs-up?

Proud to be a Datanaut!




Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.

Top Solution Authors
Top Kudoed Authors