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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

My Table Pivot isn't working

I have a table with an index column [Index] as a unique identifier, an [Attribute] column which holds whether the [Result] is the category name or category result (the only two values in this column are 'Cat' and 'Result'), a [Value] column which holds either the category name or category result.

In order to split [Attribute] into two columns called [Category] and [Result] I have added a second index [Index1] starting from 0 and then performed the following query: 

= Table.Pivot(Index, List.Distinct(Index1[Attribute]), "Attribute", "Value", List.Min)

But it's telling me that the name 'Index1' isnt recognised. Am I doing something wrong? 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

I couldn't seem to apply the pivot I wanted from the interface. In the end I renamed my 'Key' index to [KEY] and reverted my pivot query to look at just [Index] and it worked. I have no idea why, but it did. 

View solution in original post

4 REPLIES 4
HotChilli
Super User
Super User

Suggest using the interface ( from Transform menu) to do the pivot.

The code is passing the wrong parameters - Index1[Attribute] is not a list, Index is probably not a table.

At least try to do the Pivot from the interface and compare / contrast with the code written.

Anonymous
Not applicable

I couldn't seem to apply the pivot I wanted from the interface. In the end I renamed my 'Key' index to [KEY] and reverted my pivot query to look at just [Index] and it worked. I have no idea why, but it did. 

HotChilli
Super User
Super User

Did you write the line yourself or use the interface to produce it?

Anonymous
Not applicable

@HotChilli I wrote it myself, someone gave it to me and it worked before I had another Index column as a unique identifier. Now, it seems upset that I changed it to Index1

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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