cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
modasher
Frequent Visitor

Extract column information from rows within a table

Hi,

I would like to extract the individual rows which are from 1-11 (and they keep on repeating) into 11 columns with their respective values.

2020-04-09 12_46_07-New Message - Microsoft Power BI Community.png

 

 

Thanks,

Modasher.

1 ACCEPTED SOLUTION

Accepted Solutions
Community Support
Community Support

Re: Extract column information from rows within a table

Hi,

 

Please try to add an index column first.

Then try to create this calculated column:

Group = ROUNDUP('Table'[Index]/11,0)

Choose matrix visual, it shows:

51.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto

View solution in original post

3 REPLIES 3
Vera_33 Resolver I
Resolver I

Re: Extract column information from rows within a table

Hi @modasher 

 

Do you mean you want to pivot the every 11 rows to a table with 11 columns? Use Power Query to pivot it.

 

#1 add a custom column - Table.AddColumn(your last step, "Custom", each Number.IntegerDivide([Column Index]-1,11))

#2 remove the index column - Table.SelectColumns(#"Added Custom",{"Custom", "display_name","value"})

#3 pivot the table - Table.Pivot(#"Removed Other Columns", List.Distinct(#"Removed Other Columns"[display_name]), "display_name", "value")

Super User IV
Super User IV

Re: Extract column information from rows within a table

@modasher ,

Please see if this can help

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

 

Refer, if this code can help

https://docs.microsoft.com/en-us/powerquery-m/table-pivot





Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
In case it does not help, please provide additional information and mark me with @
My Recent Blogs -Decoding Direct Query - Time Intelligence, Winner Coloring on MAP,
HR Analytics, Power BI Working with Non-Standard TimeAnd Comparing Data Across Date Ranges
Proud to be a Super User! Linkedin


Community Support
Community Support

Re: Extract column information from rows within a table

Hi,

 

Please try to add an index column first.

Then try to create this calculated column:

Group = ROUNDUP('Table'[Index]/11,0)

Choose matrix visual, it shows:

51.PNG

Here is my test pbix file:

pbix 

Hope this helps.

 

Best Regards,

Giotto

View solution in original post

Helpful resources

Announcements
‘Better Together’ T-Shirt Contest – Winner Announced!

‘Better Together’ T-Shirt Contest – Winner Announced!

And the winner is...

Announcing the New Spanish Forum

Announcing the New Spanish Forum

Do you need help in Spanish? Check out our new Spanish community section.

April 2020 Community Highlights

April 2020 Community Highlights

Info on our Super Users, MBAS content and badges, and updates to our support articles. - Read the full Community Highlights.

MBAS Gallery 2020

MBAS Gallery 2020

Watch Microsoft Business Applications Summit sessions on-demand.

Top Solution Authors
Top Kudoed Authors