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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
JAgius
Regular Visitor

Query: Assigning Rows to columns

 Hey Guys,

 

i have two queries and have to combine them. One are the Headers for the desired Columns and in my other i have all the data just in one Column. They are 24 Columns and the Value of Row1 has to be combined to Column1 , Row2 to Column2.... Row25 to Column1.....

 

Is this possible ? Thanks in Advance

 

 

2 REPLIES 2
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @JAgius,

 

Could you please mark the proper answer as solution or share the solution if it's convenient for you?

 

Best Regards!
Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @JAgius,

 

Two approaches here. If you are familiar with R, you can try the approach 1. 

1. R code.

# 'dataset' holds the input data for this script
c <- dataset$Value  
length(c) <- prod(dim(matrix(c, ncol = 24))) # this step will insert null instead of recycling.
temp <- matrix(c, ncol = 24, byrow = T)
result <- data.frame(temp) # Power BI accept data frame.

2. Using pivot function. Please check out this file

Query_Assigning_Rows_to_columns

 

Best Regards,

Dale

 

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.