The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
I'm creating a pivot table based on a large access database. In access, there's many rows per item number, and one column containing many attributes and another with the values of those attributes. In excel, I pivot the attributes/values columns (about 500 columns total) and it ends up looking like this, still with many rows but all attribute values blank except one. Is there an easy way to combine them? Like a Group By function but on a larger scale without having to make new columns? I'm not super familiar with M code, so am stumbling on one part chatgpt can't figure out when asked lol
Item Number | Length (in) | Length (mm) | Width (in) | Width (mm) |
200 | (blank) | (blank) | (blank) | (blank) |
.62 | (blank) | |||
866 | (blank) | (blank) | ||
34.1 | (blank) | (blank) | (blank) | |
201 | (blank) | (blank) | (blank) | (blank) |
.63 | (blank) | |||
632 | (blank) | (blank) | ||
24.9 | (blank) | (blank) | (blank) | |
202 | (blank) | (blank) | (blank) | (blank) |
.63 | (blank) | |||
434 | (blank) | (blank) | ||
17.1 | (blank) | (blank) | (blank) | |
203 | (blank) | (blank) | (blank) | (blank) |
.63 | (blank) | |||
645 | (blank) | (blank) | ||
25.4 | (blank) | (blank) | (blank) | |
204 | (blank) | (blank) | (blank) | (blank) |
.63 | (blank) | |||
315 | (blank) | (blank) | ||
12.4 | (blank) | (blank) | (blank) |
Solved! Go to Solution.
I am not 100% sure this is what you are looking for...
If you are starting with data like...
You can use the Pivot Column (Table.Pivot) feature to end up with...
Select the "Attribute" column and click the 'Pivot Column' icon on the transform ribbon.
Use the value column in the 'Values Column' and select 'Don't Aggregate' in the Advanced options.
Hope this gets you pointed in the right direction.
Proud to be a Super User! | |
Using the example data from above, selecting the 'Item' column and grouping with 'All Rows' aggregation will get you...
There are no columns added to the nested tables. They are just the rows that share the Item number...
Item 200 as example...
You can transform the nested columns if need to though you would need to use the Table.TransformColumns function as there is no UI feature for that.
Proud to be a Super User! | |
Hi @l9854,
I wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
If the community member's answer your query, please mark it as "Accept as Solution" and select "Yes" if it was helpful.
If you need any further assistance, feel free to reach out.
Please continue using Microsoft community forum.
Thank you,
Pavan.
Hi @l9854,
I wanted to follow up since we haven't heard back from you regarding our last response. We hope your issue has been resolved.
If the community member's answer your query, please mark it as "Accept as Solution" and select "Yes" if it was helpful.
If you need any further assistance, feel free to reach out.
Thank you,
Pavan.
Hi @l9854,
Thank you for reaching out in Microsoft Community Forum.
I trust @jgeddes response is accurate and will address your issue.
If you have any further questions or updates regarding your issue, feel free to ask, and we will look into that.
If the Super User's answer meets your requirements, please consider marking it as the "Accept as Solution" and click on "yes"
Please continue using Microsoft community forum.
Regards,
Pavan.
I am not 100% sure this is what you are looking for...
If you are starting with data like...
You can use the Pivot Column (Table.Pivot) feature to end up with...
Select the "Attribute" column and click the 'Pivot Column' icon on the transform ribbon.
Use the value column in the 'Values Column' and select 'Don't Aggregate' in the Advanced options.
Hope this gets you pointed in the right direction.
Proud to be a Super User! | |
Thank you! That is what I did to create the columns previously.Very useful feature. Now I'm just looking to consolidate the rows. Thanks for the tip!
The Group By feature would help with consolidation. Make sure that you explore the advanced options there as well. The ability to group and keep all related rows in a nested table is a very powerful tool.
Proud to be a Super User! | |
is there a way i can use the group by function without creating new columns?
Hey!
If you end up with a table that looks like the one in your example, then there might be another column in the table, that makes it unique. in that case it will create extra rows .
For demonstration purposes i've added the column Color to your data.
When I pivot the column now it will create extra rows:
if I remove the column that makes it 'unique'. It wil combine them into a single row:
Hopefully this helps! if so, please consider giving kudo's and accepting this answer as a solution, so other members qith the same problem can find it quicker!
Using the example data from above, selecting the 'Item' column and grouping with 'All Rows' aggregation will get you...
There are no columns added to the nested tables. They are just the rows that share the Item number...
Item 200 as example...
You can transform the nested columns if need to though you would need to use the Table.TransformColumns function as there is no UI feature for that.
Proud to be a Super User! | |