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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
PhilippeMuniesa
Resolver I
Resolver I

PivotTable error duplicate itemsPivotTable error duplicate items

Hello (From France)

 

Below excerpt from a table

 

Mois_DsnRubriqueValeurNss
1S21.G00.40.001010120142870556178110
1S21.G00.40.001140120212970229024223
1S21.G00.40.001020120212970229024223
2S21.G00.40.001010120142870556178110
2S21.G00.40.001010220212970229024223
3S21.G00.40.001010120142870556178110

 

 

I need to make a pivot table with the "Rubrique" in column name and values in rows

 

The problem is that there are duplicate items, with different values, and in this case the PivotTable generates errors in cells.

(Expression.Error: There were not enough items in the enumeration to complete the operation.
Details:
[List])


the solution would be to calculate a "Rubrique" index ("Mois-Dsn" identical + Indentical "Rubrique" + Identical "Nss")
The first occurrence is equal to 1
The second occurrence at 2 .. Etc.
The goal is to obtain the following table,

 

Mois_DsnRubriqueValeurNssindice Rubrique
1S21.G00.40.0010101201428705561781101
1S21.G00.40.0011401202129702290242231
1S21.G00.40.0010201202129702290242232
2S21.G00.40.0010101201428705561781101
2S21.G00.40.0010102202129702290242232
3S21.G00.40.0010101201428705561781101

 

and merge Heading and Index Heading before doing the pivot table

 

 

Mois_DsnNssS21.G00.40.001_1S21.G00.40.001_2
1287055617811001012014 
129702290242231401202102012021
2287055617811001012014 
22970229024223 01022021
3287055617811001012014 
    

 

to obtain the following result

But how to get the Topic Index column ...

 

I have tried several solutions, but I block on this point

 

Thank you for your valuable help

 

Philippe

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @PhilippeMuniesa ,

 

Please refer to this video for the steps, hope this helps:
Count Occurrence Or Add Index Number To Group Data | Power Query & PowerBI

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

View solution in original post

3 REPLIES 3
PhilippeMuniesa
Resolver I
Resolver I

exactly that i need

 

Thanks a lot

 

PH MUNIESA

PhilippeMuniesa
Resolver I
Resolver I

Sorry for misformatting sample tables

Attached is the Excel version of this description

 

https://www.dropbox.com/t/RcKfZ1yXFbO3EqwD 

 

Thanks in advance for a solution

 

Philippe Muniesa

Anonymous
Not applicable

Hi @PhilippeMuniesa ,

 

Please refer to this video for the steps, hope this helps:
Count Occurrence Or Add Index Number To Group Data | Power Query & PowerBI

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly -- How to provide sample data

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors