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

Nested Group By

Hello PowerBI experts,

 

I need some help with a situation.

I have a datasource that is looking like this.

 datasource.png

I try to do a nested group by and have an output like :

Red

  Line 1

  Line 3

   total

Green

  Line1

  Line4

   total

Blue

 Line2

   total

 

Can you give me some hints how to accomplish this ?

Thank you.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I find an workarround.

I did 3 copies of the querry.

To first I renamed column A to SalesPerson, to second I renamed column B to SalesPerson to third querry I renamed column C as SalesPerson.

Then I combined this 3 queries to one and I have a common column, SalesPerson.

 

Maybe there a better solution. Time to load data is increased with this method.

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

I find an workarround.

I did 3 copies of the querry.

To first I renamed column A to SalesPerson, to second I renamed column B to SalesPerson to third querry I renamed column C as SalesPerson.

Then I combined this 3 queries to one and I have a common column, SalesPerson.

 

Maybe there a better solution. Time to load data is increased with this method.

Anonymous
Not applicable

Solution what I found is to make 3 copies of the query source.

Unpivot each copy table bt column A, column B and column C to a common column SalesPerson and merge them after.

 

v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

I cannot understand your requirement very well. What does "Line1", "Line3" refer to? Could you please describe the desired output with more details? If possible, please show your desired result with an image.

 

Regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

I need a grouping by sales person.  But sales person can be on one of first 3 columns.

Sales person Red is on  first line and third line. and so on.

I think a method is to unpivot table.

 

 

 

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 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.

Top Solution Authors