Forum Discussion
Pivoting date field issue
- 6 years ago
gustavo80 see attached, you just unpivot and then view in a matrix, it is the easiest and most scalable solution and follows the best practice from a data modeling perspective.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
Why are you pivoting out the dates? In almost all cases, that makes your model harder to analyze/visualize. If you really need to do it, you can likely use Table.ColumnNames() to dynamically generate a list of your date column names to use in whatever function currently has a list of static column names.
But you should have a really good reason for doing the pivot. Your starting table structure is good (you could even consider unpivotting it further), and you can make your desired visual showing 4 dates from that kind of structure.
If this works for you, please mark it as solution. Kudos are appreciated too. Please let me know if not.
Regards,
Pat
Thanks for the quick response! I obviusly prefer not to pivot, it was just a try that I made to show the information as I need ( dates in columns, measures in rows ).
How should I do ? I tried with a table and with a matrix but I coudn't show the data as I need :S
- parry2k6 years ago
Super User
gustavo80 see attached, you just unpivot and then view in a matrix, it is the easiest and most scalable solution and follows the best practice from a data modeling perspective.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!