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

The FabCon + SQLCon recap series starts April 14th at 8am Pacific. If you’re tracking where AI is going inside Fabric, this first session is a can't miss. Register now

Reply
Anonymous
Not applicable

Show Table Columns as Row

Hi All,

Seeking you help on my issue. I have a this table below which has a column that I need to convert as rows

BranchYearMonthTotal ProductTotal SalesHouse LoanCar LoanPreferred Client
Asia2019125    100,000.00Yes Yes
Asia202011    500,000.00 YesYes
Asia202026  2,010,150.00YesYesYes
Asia2021115      30,000.00YesYes 
Asia2021218      35,120.00   
Europe20201250    101,010.00Yes  
Europe202011100    202,020.00YesYes 
Europe2021225        5,000.00   
Europe2021320        1,000.00  Yes
Europe2021430      25,000.00 Yes 

 

I need the last 3 columns to be shown as row as shown below (summarize per branch, year and month column)

BranchYearMonthKey DriversTotal ProductTotal Sales
Asia201912House Loan5100000
Asia201912Car Loan  
Asia201912Preferred Client5100000
Asia20201House Loan  
Asia20201Car Loan1    500,000.00
Asia20201Preferred Client1    500,000.00
Asia20202House Loan6 2,010,150.00
Asia20202Car Loan6 2,010,150.00
Asia20202Preferred Client6 2,010,150.00

 

Any solution is highly appreciated.

Looking forward for you advise. Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Just follow the formula in the article and create the following calculation table

Table1 = 
FILTER(
    UNION(
        SELECTCOLUMNS('Table',"Branch",[Branch],"Year",[Year],"Month",[Month],"Total Product",[Total Product],"Total Sales",[Total Sales],"Key Drivers",[Column]),
        SELECTCOLUMNS('Table',"Branch",[Branch],"Year",[Year],"Month",[Month],"Total Product",[Total Product],"Total Sales",[Total Sales],"Key Drivers",[Column 2]),
        SELECTCOLUMNS('Table',"Branch",[Branch],"Year",[Year],"Month",[Month],"Total Product",[Total Product],"Total Sales",[Total Sales],"Key Drivers",[Column 3])

    ),
    [Key Drivers]<>"")

1.png

 

 

 

Best Regards,

Stephen Tao

 

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

View solution in original post

6 REPLIES 6
Anonymous
Not applicable

Hi @Anonymous ,

 

Please kindly refer to 

DAX Unpivot

 

You only need one more step than the steps in the article and replace YES with the corresponding column name.

You can create the calculated column like

Column = IF([House Loan]="Yes","House Loan")

Screenshot 2021-06-25 174115.png

 

 

Best Regards,

Stephen Tao

 

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

Anonymous
Not applicable

Thank you for your response and to the link to the similar query before. I need to deep dive into how I can manage those with multiple values into one column.(House Loan = YES; Preferred Client = YES)

Anonymous
Not applicable

Hi @Anonymous ,

 

Just follow the formula in the article and create the following calculation table

Table1 = 
FILTER(
    UNION(
        SELECTCOLUMNS('Table',"Branch",[Branch],"Year",[Year],"Month",[Month],"Total Product",[Total Product],"Total Sales",[Total Sales],"Key Drivers",[Column]),
        SELECTCOLUMNS('Table',"Branch",[Branch],"Year",[Year],"Month",[Month],"Total Product",[Total Product],"Total Sales",[Total Sales],"Key Drivers",[Column 2]),
        SELECTCOLUMNS('Table',"Branch",[Branch],"Year",[Year],"Month",[Month],"Total Product",[Total Product],"Total Sales",[Total Sales],"Key Drivers",[Column 3])

    ),
    [Key Drivers]<>"")

1.png

 

 

 

Best Regards,

Stephen Tao

 

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

Anonymous
Not applicable

thank you Stephen!. I followed the instruction as stated. The solution works like a charm 🙂

amitchandak
Super User
Super User

@Anonymous , Try unpivot in power query

https://radacad.com/pivot-and-unpivot-with-power-bi

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

thank you for your response, unfortunately the 3 columns are not available (visible) in the power query editor.

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.