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
vcan
New Member

How do I add rows below certain cells in Power Query

Hello, 

 

I am very new to Power Query and could use some help!

We have products such as Variety Packs that contain an assortment of existing products.  In order to get a full count of each product, we need to account for the units in the Variety Packs as well.  However, our data does not break up the Variety Pack by whats included inside, and just says "Variety Pack".

 

I was wondering if it were possible in Power Query to conditionally add a certain amount of rows under "Variety Pack" every time is occurs.  

 

Desired Data: (Currently just the Variety Pack line)

vcan_0-1660681747863.png

 

This would have to be done separately for different variety packs as well.

I can elaborate more if needed! Any help is appreciated!

 

1 REPLY 1
jbwtp
Memorable Member
Memorable Member

Hi @vcan,

 

This is  possible. You can use something like List.Accumulate(Table.ToRecords(...), ...) and analise it or few otherstrategies, but would you be able to explain why would you need it? The data tables works in a quite different way compared to e.g. Excel. Generally, there is no guarantee that the lines will be processed in a certain sequence in DAX or visual after the data is passed from the query. What is your plan for controlling after which Variety Pack any given Product A is following?

 

Thanks,

John

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.

Top Solution Authors