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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Anonymous
Not applicable

Another Pivot Problem

Update: It appears that there is a row limit for pivot tables.  If I reduce the number of rows from 4,000 to 2,000, then it works. 
I will have to filter the table before I can pivot it.
Thank you for the responses, but it looks like I can't delete this post, unfortunately.

 

---  

Original message:

Suppose I have a table like this:

Measurement TypeCountryYearValue
AAustralia200832775
AAustralia201026556
AAustralia201221315
BAustralia200821570
BAustralia201022430
BAustralia201225290
ABrazil200835475
ABrazil201034205
ABrazil201231720
BBrazil200834040
BBrazil201021240
BBrazil201235290


Goal

I want to pivot the Year column so that the data is shaped like this:

Measurement TypeCountry200820102012
AAustralia327752655621315
BAustralia215702243025290
ABrazil354753420531720
BBrazil340402124035290

 

What I'm seeing instead

When I attempt to pivot the Year column, using the values in the Value column, the result is a table with only the first two columns: the Year and Values are gone.  I've tried using the "Advanced options" set to "Don't aggregate" and set to "Average", and both options result in this:

Measurement TypeCountry
AAustralia
BAustralia
ABrazil
BBrazil

 

What am I missing or doing wrong?

8 REPLIES 8
Anonymous
Not applicable

HI @Anonymous,

I'd like to suggest you to use the import feature to import excel workbook and its expression formulas:

Import Excel workbooks into Power BI Desktop 
Regards,

Xiaoxin Sheng

amitchandak
Super User
Super User

@Anonymous , see if this help

https://radacad.com/pivot-and-unpivot-with-power-bi
Transpose : https://yodalearning.com/tutorials/power-query-helps-transposing-data/

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

If I transpose the table I get every country as it's own column, which is... different, unfortunately.

@Anonymous ,

 

Paste this code on the Advanced Editor:

 

let
Source = Table.FromRows(Json.Document(Binary.Decompress(Binary.FromText("dY+xDoQwDEP/pTND4iSUG+E3EENHJCYOFr7+aCtBpWsnR7L17MyzG13nxvN77GFbw32DaLhF4L25pasFmKL0Zn0rgCgsnAlTvQJsnhqBXAGVZiBVGD70bJj2cK1b8YJp8ULhJrgoqO5GsrDHW/1HVtKqm2czGm4i583LDw==", BinaryEncoding.Base64), Compression.Deflate)), let _t = ((type nullable text) meta [Serialized.Text = true]) in type table [#"Measurement Type" = _t, Country = _t, Year = _t, Value = _t]),
#"Changed Type" = Table.TransformColumnTypes(Source,{{"Measurement Type", type text}, {"Country", type text}, {"Year", Int64.Type}, {"Value", Int64.Type}}),
#"Pivoted Column" = Table.Pivot(Table.TransformColumnTypes(#"Changed Type", {{"Year", type text}}, "pt-BR"), List.Distinct(Table.TransformColumnTypes(#"Changed Type", {{"Year", type text}}, "pt-BR")[Year]), "Year", "Value")
in
#"Pivoted Column"

 



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



camargos88
Community Champion
Community Champion

Hi @Anonymous ,

 

Try this one:

 

Select the Year column, click on pivot and: 

Capture.PNG

 

The point here is not aggregate the values.



Did I answer your question? Mark my post as a solution!

Proud to be a Super User!



Anonymous
Not applicable

Indeed, that was what I did, but the outcome was not as expected, however I appreciate the message.

lbendlin
Super User
Super User

Measure Type and Country go into the Row bucket, Year goes into the Column bucket, and Value to the values.  Is that what you did?

Anonymous
Not applicable

If I was using the matrix vizualization, that would give the desired appearance, but alas, it would not actually change the table.

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors