Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Pic 1
My current data looks like the above image and I want to have all the rows in the column ProjectID without any duplicates. I tried to unpivot and pivot the data and ended with pic2Pic 2
Although I got the required format, I get the error "There were too many elements in the enumeration to complete the operation". As you can see, it displays the non-duplicate rows but gives errors for the rest.
I looked at other threads with the same problem but it did not work out. Any help is appreciated. Thank you.
Hi @Anonymous ,
Error: "There were too many elements in the enumeration to complete the operation"
This error is because another column is not aggregated when you Pivot column.(When there are duplicate columns in your table.)
You can try using the "Remove Duplicates" feature.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @v-lionel-msft
Thank you your reply. The program ID in the picture has sub programs with IDs and each sub program has different country, region, donor etc. If I use remove dupliactes I will lose the sub project information. Please imagine a hierarchy where program is the top one and it has sub programs with respective info. I want all of these columns to correspond to one Program ID in a single row. I do not anyway need sub program ID in the end but let's take countries column for example. It should display all countries that belong to this program. In the same way, all the other columns should also correspond to the program ID.
Before : 50000 1 US A
2 UK B
3 US A
After: 50000 US,UK A,B
I hope I made it clear. Thank you.
Hi @Anonymous ,
Maybe you can do like this:
1. Remove [Column2]
2. Select columns 1 and 3 at the same time and delete duplicate columns, you can get this:
3. Transpose the table:
3. Merge the two columns:
4. Transpose the table again:
5. Replae the value:
You can refer to the applied steps in Edit Queries.
Best regards,
Lionel Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello @GilbertQ
Thank you for you reply. I want to have one line per every project. I do not want any duplicates in the projectIDS and want all the other columns to correspond to the respective proejct. As I mentioned in the post, it displays all the rows (projects) which are single or do not have any duplicates. All the other rows (or projectIds) with multiple mentions are displaying errors.
User | Count |
---|---|
45 | |
26 | |
21 | |
19 | |
18 |
User | Count |
---|---|
51 | |
45 | |
24 | |
24 | |
21 |