Forum Discussion
Anonymous
5 years agoNot applicable
'Flipping' a horizontal fact table into a vertical fact table
This is a bit of a weird one to explain, but here goes.
I'm trying to visualise some timelines using either Timeline by Queryon or Timeline Storyteller.
It appears for both of these custom visuals, the data that needs to be provided should be in this format:
TABLE A
| Case File | Milestone | Date |
| CS1 | Query 1 | |
| CS1 | Query 2 | |
| CS1 | Query 3 | |
| CS1 | Query 4 | |
| CS1 | Query 5 | |
| CS1 | Info Request 1 | |
| CS1 | Info Request 2 | |
| CS1 | Info Request 3 | |
| CS1 | Closed | |
| CS2 | Query 1 | |
| CS2 | Query 2 | |
| CS2 | Query 3 | |
| CS2 | Query 4 | |
| CS2 | Query 5 | |
| CS2 | Info Request 1 | |
| CS2 | Info Request 2 | |
| CS2 | Info Request 3 | |
| CS2 | Closed | |
| CS3 | Closed | |
| CS3 | Query 1 | |
| CS3 | Query 2 | |
| CS3 | Query 3 | |
| CS3 | Query 4 | |
| CS3 | Query 5 | |
| CS3 | Info Request 1 | |
| CS3 | Info Request 2 | |
| CS3 | Info Request 3 | |
| CS3 | Closed |
However, the data that is being collected by users on the project I am working on is in this format:
TABLE B
| Case File | Query 1 | Query 2 | Query 3 | Query 4 | Query 5 | Info Request 1 | Info Request 2 | Info Request 3 | Closed |
| CS1 | 01/01/2021 | 10/01/2021 | 23/01/2021 | 24/01/2021 | 31/01/2021 | 03/01/2021 | 12/01/2021 | 25/01/2021 | 01/02/2021 |
| CS2 | 02/01/2021 | 11/01/2021 | 24/01/2021 | 25/01/2021 | 01/02/2021 | 04/01/2021 | 13/01/2021 | 26/01/2021 | 02/02/2021 |
| CS3 | 03/01/2021 | 12/01/2021 | 25/01/2021 | 26/01/2021 | 02/02/2021 | 05/01/2021 | 14/01/2021 | 27/01/2021 | 03/02/2021 |
The Case File column contains a unique reference for each case file, so it's also used as a dimension table to form relationships with other sets of data.
Is there a way of converting Table B into Table A using powerquery?
Select the first column and 'Unpivot other columns'
2 Replies
- HotChilli
Community Champion
Select the first column and 'Unpivot other columns'
- AnonymousNot applicable
O.M.G. Thank you so much, this works!