Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi All, I have data coming from My SQL databse and i had to pivot the columns to make it in a readable format.
i have 2 colums with call_started & call_completed with UNIX datetime format. First i had to covert them to whole number format and then i managed convcert to proper date and time format by adding custom columns.
after i do that i cant save the query anymore and its giving me error as below. Please help
Solved! Go to Solution.
Hi @Bokbob,
The above error could occur when you pivot columns with same name, please check column names in your data source. And there is a similar thread for your reference.
https://social.technet.microsoft.com/Forums/en-US/7923e025-a0c4-407b-bd0f-65959e5038bb/what-does-thi...
Thanks,
Lydia Zhang
Thanks Everyone for your inputs.
After change type and after adding custom columns somehow its been adding duplicate columns. I could see it in numbers on bottom left hand side where it shows total columns and rows. then i knew that there was a duplicate one.
I went to table column options and choose remove duplicates and it removed thos duplicate columns and all good after that.
Phewww 🙂
With my repeated tests i performed to see where it is going wrong.. i actually noticed that it is not liking it after we change the column type. it was text and i changed it to Whole number and then when i try to save and apply changes it comes up with that error message.
Also when i simply filter/remove some columns and apply changes it doesnt like it.
Any help is appriciated ..
Are you aggregating in the pivot-operation?
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
No am not aggregating on any of those columns
when i pivot my columns i picked dont aggregate option.
Hi @Bokbob,
The above error could occur when you pivot columns with same name, please check column names in your data source. And there is a similar thread for your reference.
https://social.technet.microsoft.com/Forums/en-US/7923e025-a0c4-407b-bd0f-65959e5038bb/what-does-thi...
Thanks,
Lydia Zhang
Thanks Everyone for your inputs.
After change type and after adding custom columns somehow its been adding duplicate columns. I could see it in numbers on bottom left hand side where it shows total columns and rows. then i knew that there was a duplicate one.
I went to table column options and choose remove duplicates and it removed thos duplicate columns and all good after that.
Phewww 🙂
I found this post in looking for an answer to the same problem, but found the explanation did not fit my scenario. Here is a more complete explanation for the error:
The Pivot function is a group by operation. It requires a Pivot column and a Value column, all remaining columns can be considered as the GROUP BY columns. When there are multiple rows that will be collapsed by the group by, you have to specify the advanced option and chose an Aggregate Value Function.
In my case, I was working with string values, so left it as "Don't Aggregate", which resulted in the "too many elements" error. Changing the aggregate to MIN or MAX worked, but did not get me the results needed, but did explain why I was getting the error.
Unless you know your data set is only going to have one value per combo of Pivot Column and Group By columns, you need to specify an aggregate.
Hope that helps,
Clayton
I had this situation and I added an Index column right at the start.
I had to remember to include the Index column in all subsequent operations to prevent strange outputs but it seems to work for my case.
Rich
OK, then this messages pops up if the remaining columns (those who are not unpivoted and are not in the values-section) don't provide a unique key to the result of the pivot.
The conversion could have eliminated unprintable characters or sth similar that produced duplicates in pairs of values who previously have been different. You can check this by counting the number of rows in both pivot-versions: If the later has less rows, you know that there have been dups in it.
Imke Feldmann (The BIccountant)
If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!
How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries
Check out the September 2024 Power BI update to learn about new features.
Learn from experts, get hands-on experience, and win awesome prizes.
User | Count |
---|---|
71 | |
63 | |
40 | |
28 | |
17 |