crackednut
New Member
- Joined
- Feb 12, 2015
- Messages
- 5
hi all,
I'm a power BI newbie and trying to get a handle on unpivoting multi-header columns. I followed the tips mentioned on the well detailed page (Unpivot Columns in Power BI - New Tech Dojo) . However, it slightly more complicated than the one shown on the page.
Link to the data set on G Drive--> unpivot test data_v02 sample.xlsx
To summarise the problem statement. My current dataset sits something like this (there are around 25 markets)
the required output would need to look this:
the normal unpivot solutions all are pointing in the direction where the 6 dataypes on the right hand side get merged into a single column. only problem with that approach is they are all different datatypes (numeric, time etc)
I believe custom coding in M holds some magic to unlock this mystery. I have very little knowledge of M and am knocking on this forum's doors. How does one go about doing this?
I must also mention that I am dealing with an extremely large excel sheets here. These are massive data dumps around 600MB of excel files each. Hence I am wary of not grinding my machine to a halt with excessive & undesirable unpivot queries. I tried it doing unpivotting one bunch of column at a time but the number of rows increasing exponentially. This is what leads me to believe that M coding might do the trick.
I'm a power BI newbie and trying to get a handle on unpivoting multi-header columns. I followed the tips mentioned on the well detailed page (Unpivot Columns in Power BI - New Tech Dojo) . However, it slightly more complicated than the one shown on the page.
Link to the data set on G Drive--> unpivot test data_v02 sample.xlsx
To summarise the problem statement. My current dataset sits something like this (there are around 25 markets)
market01 | market 02 | ||||||||
channel | date | title | programme | datatype1 | ... | datatype6 | datatype1 | ... | datatype6 |
the required output would need to look this:
channel | date | title | programe | market | datatype1 | datatype2 | datatype3 | ... | dataype6 |
market01 | |||||||||
market01 | |||||||||
market02 | |||||||||
market02 |
the normal unpivot solutions all are pointing in the direction where the 6 dataypes on the right hand side get merged into a single column. only problem with that approach is they are all different datatypes (numeric, time etc)
I believe custom coding in M holds some magic to unlock this mystery. I have very little knowledge of M and am knocking on this forum's doors. How does one go about doing this?
I must also mention that I am dealing with an extremely large excel sheets here. These are massive data dumps around 600MB of excel files each. Hence I am wary of not grinding my machine to a halt with excessive & undesirable unpivot queries. I tried it doing unpivotting one bunch of column at a time but the number of rows increasing exponentially. This is what leads me to believe that M coding might do the trick.