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

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Power Query - Dataset Transformation

I have the following dataset from dataflow and some additional steps in power query. 

 

Before.png

 

 

Now that I have this, is there anyone that can guide on the best method to transform as follows:

 

After.png

8 REPLIES 8
Anonymous
Not applicable

I have managed to get this data in the right format.

Anonymous
Not applicable

Hi @Anonymous ,

I'm not quite sure what your needs are, are you trying to convert the data in that screenshot above to the format in the one below, or are you trying to convert the data in the screenshot below to the format in the one above?

Best Regards,
Dino Tao

Anonymous
Not applicable

I have the top and want to transform to the below.

Anonymous
Not applicable

Hi @Anonymous ,

Neither M code in Power Query nor DAX in Power BI Desktop enables splitting a table and adding a TOTAL row for each sub-table. My suggestion is that you put the table into a matrix visual object and set both the column Entity and the column Vendor Number to the row headers.
Or you can try using Report Builder to create a paginated report.

Best Regards,
Dino Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

dufoq3
Community Champion
Community Champion

It is possible with M, but this is not purpose of PowerQuery.


Note: Check this link to learn how to use my query.
Check this link if you don't know how to provide sample data.

Hi,
This can be done inside power query by taking advantage of the m language.

Anonymous
Not applicable

Thanks - this is what I intent to do - it's the syntax of the m language that I am looking for some guidance with.

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.