Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
This is my first post on this forum, but I've been 'lurking' around for a while, learning as I go. Hopefully one of you BI-wizards can help me out with my particular case for which I couldn't find an anwser.
In my Power BI I have a table with id's and dates. I'm trying to combine the rows based on the id (so this column will be a unique identifier) while combining the data from the differen't columns.
Example of my table:
id | StartDate | FollowupDate | FinishedDate |
101 | 1-1-2016 | null | null |
101 | null | 1-2-2016 | null |
101 | null | null | 2-2-2016 |
102 | 3-1-2016 | null | null |
102 | null | null | 5-1-2016 |
103 | 3-1-2016 | null | null |
Result I'm trying to get:
id | StartDate | FollowupDate | FinishedDate |
101 | 1-1-2016 | 1-2-2016 | 2-2-2016 |
102 | 3-1-2016 | null | 5-1-2016 |
103 | 3-1-2016 | null | null |
I have a feeling this should be easy to do, but I've been searching around for quite a while without result.
Any idea how I can accomplish this in Power BI?
Solved! Go to Solution.
Sorry, forgot to mention that you need to turn the aggregation off: last step: Advanced Opions: Don't aggregate bofore hitting the last OK.
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
HI there, I have similar prolem. I could find the post for the solution. Could you please repost the solution
Hi Imke,
I tried your solution for one of my data which i need in same format.
1) Check column ID -> Mouse rightclick -> Unpivot Other Columns: This will delete the nulls
2) Check column Attribute -> Transform -> Any Column -> Pivot Column: Choose "Value" in Values Column
But its giving error "There were too many elements in the enumeration to complete the operation.". Can you please help?
Regards,
Shruti
I had the same problem but i solved it by adding this after step 1:
1) Check column ID -> Mouse rightclick -> Unpivot Other Columns: This will delete the nulls
1.1) Select Column ID and Attribute together -> mouse right click -> remove duplicates
2) Check column Attribute -> Transform -> Any Column -> Pivot Column: Choose "Value" in Values Column (Advanced Options: Don't aggregate bofore hitting the last OK.)
That's because your table is missing a unique identifier that determines the row.
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
Imke - perhaps you can help me with a similar situation. I am also trying to combine data like the previous users but mine would be by date and I want the sum of the numbers instead of just a count. It looks like the aggregate only gives a count?
The situation is multiple locations entering data into different tables on the same date and I would like to combine those into a global sum for each attribute being tracked while having accurate monthly/quarterly numbers.
Hi @Anonymous ,
Not sure I can follow. Could you please share (link to) some sanitzed sample data ?
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
Hi all, I am having very similar problems to the above, as you can see below the Id numbers are sorted in order and there is data in different columns:
Then when you follow the process mentioned.... After the first step, something weird happens:
Then when you apply the second stage they all become errors:
It feels like there is something really simple to fix here?
This is one of my favourites 🙂
1) Check column ID -> Mouse rightclick -> Unpivot Other Columns: This will delete the nulls
2) Check column Attribute -> Transform -> Any Column -> Pivot Column: Choose "Value" in Values Column
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
Hi Imke, thanks so much for your help so far!
This seems to get me part of the way there, but the resulting values (after pivot) are only 0 or 1instead of the dates.
Example:
id | StartDate | FollowupDate | FinishedDate |
101 | 1 | 1 | 1 |
102 | 1 | 0 | 1 |
103 | 1 | 0 | 0 |
If I change type to date, the results are not accurate, all in 1899.
Does anyone know what I can try?
Sorry, forgot to mention that you need to turn the aggregation off: last step: Advanced Opions: Don't aggregate bofore hitting the last OK.
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
Hi ImkeF,
I am trying to find the solution to this thread without success.
Could you share it?
I am trying to accomplish something similar and when I hit Ok after selecting Don't Aggregate, my data returns Errors.
When I click on the Error Link, it says "There were too many elements in the enumeration to complete the operation."
Any suggestions?
Thanks!
R
This is due to the fact that the column you've checked (where you say: "Unpivot others") would have duplicates after the operation / there would be more than 1 value in a cell.
I need to see a sample of your data to tell you how to overcome this.
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
Hi Imkef,
I have de same problem. Some rows have error "There were too many elements in the enumeration to complete the operation."
I show you a picture of mi example. What do you need to help me?
Hope you can help Me
Regards
Hi @Anonymous ,
These errors mean that you're trying to bring data into one row where there's actually more than one value per pivoted column. So you have to make up your mind and decide what to do with these multipe values: Combine then into one or delete them, because there are errors, create a separater table ... whatever is appropriate for your specific case.
To visualize the problem, you can add the following code as the 5th parameter to your Table.Pivot-function:
each Text.Combine(_, "#(lf)Additional Item: ")
This will create a line feed and a starting phrase for every multiple item in these rows.
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
Hi @ImkeF
I know. If you want i can show you the file.pbx. These duplicate values are the "Titles" i want to have for the columns. The thing is that if i eliminate those values from the column "Attribute",it also eliminates the row of the column "Value". Sorry for my english. I show you what i need to have:
Legajo | Estilo Personal | Área de Mejora |
145 | information | information |
567 | information | information |
456 | information | information |
546 | information | information |
And i show you what i have:
As you see, the information is a bit messed up. This is because it is import from pdf files which are interviews from employees.
I take your help to know if you know a better way to import files from this source (pdf files) since they complicate my work a lot.
Thanks in advance
Regards
Sorry, but I cannot find any clarification in you latest post.
Please keep your samples to the first 3 "Legajo"s: 154, 219 and 305:
The source of your data is irrelevant at this stage.
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
The error occurs because the titles "Estilo Personal" and "Áreas de Mejora" appears several times. I show you the difference between the error and the rows OK:
Before pivot:
Error example: 503
Example OK: 450
As you can see the difference are the duplicates of the titles. But as i said if i eliminate them it will eliminate all the info of the column "Value"
Thanks
If you add
each Text.Combine(_, "#(lf)")
as the 5th parameter to your Table.Pivot function, you'll get all the different rows combined with a line break in your pivot table.
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
Hi,
I may need to create a new post as this is quite a bit outdated but I am trying something similiar and need some assistance.
Here is my data:
UserName | UserEmail | Office | LoginDate | LoginTime | ViewedScreen | Type | Location | Shareholder | LetterDate | UniqueID |
Smith, John | name@company.com | 2 | 5/8/2018 0:00 | 15:35:51 | Y | 19523C53 | ||||
Y | 1 | FL | Williams, Gary | 5/8/2018 4:00 | 19523C53 | |||||
Y | 1 | GA | Smith, John | 5/8/2018 4:00 | 19523C53 |
I am using the patch/collect function in powerapps to spit this data to an excel workbook. It informs me if a user has viewed a screen, what selections they made in a dropdown etc.
My issue is as follows: A user may make multiple selections in the dropdowns and I need to track that data. (Type, Location, Shareholder & LetterDate)
As you can see in the data table above, it will collect Y for they viewed the screen, what drop down selections were made and a uniqueID for that specific session of them using the app.
I'm wondering what the best way is for me to link that data to the UniqueID but still individually be able to track the different drop-down selections, but mash together the viewscreen columns since I don't care about the duplicate Ys so long as I have one Y, but I do need the specific selections from the dropdowns to report on.
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 |
---|---|
116 | |
101 | |
87 | |
35 | |
35 |
User | Count |
---|---|
152 | |
100 | |
83 | |
63 | |
54 |