Forum Discussion
Joining columns into Fewer columns and multiple rows
- 8 years ago
Ok, had a look, you want this option below:
Highlight all columns except the data and pivot, you'll then have to extract the info from the "Attribute" column name strings.
Give me a shout if you don't know how to do this.
If this data is sourced from TSQL (or some other manipulatable source) I would be inclined to select each column individually and perform a union of each select:
Select
Date,
'A' as Location,
LOCA-QUALA as QualityA,
LOCA-QUALB as QualityB,
LOCA-QUALC as QualityC
from [Table]
union all
Select
Date,
'B' as Location,
LOCB-QUALA as QualityA,
LOCB-QUALB as QualityB,
LOCB-QUALC as QualityC
from [Table]
However I might take this a step further:
Select
Date,
'A' as Location,
'A' as Quality,
LOCA-QUALA as [Metric],
from [Table]
union all
Select
Date,
'A' as Location,
'B' as Quality,
LOCA-QUALB as [Metric],
from [Table]
union all
[etc]
If you can't manipulate in this way and it has to be PowerBI let me know and I'll give it a go,
This is the trouble with storing dimension information in the field name...