Forum Discussion
Issue with Slicing data based on the columns
Hi I have a table as below. I would like to know how to use the slicer in such a way that when I pick Year 1, it would give me a barchart with ony Year1_Median, Year1_P25 and Year1_P75 and when I pick Year 5 from the slicer it would give me allthe measures for Year5 in the bar chart(lkie below). I know I may have to restructure the data but I need to know what would be the best appraoch.
Here is the table:
| inst_name | Year1_Median | Year1_P25 | Year1_P75 | Year5_Median | Year5_P25 | Year5_P75 |
| abc | 61691 | 51578 | 69881 | 62427 | 48395 | 71718 |
| abc | 67840 | 60275 | 74638 | 76283 | 60662 | 89644 |
| abc | 75504 | 51767 | 85939 | |||
| abc | 54577 | 50854 | 116518 | |||
| abc | 43174 | 38945 | 44991 | 62307 | 54122 | 74470 |
| abc | 52272 | 42030 | 54537 | 59718 | 48399 | 92076 |
| cda | ||||||
| cda | 59793 | 49035 | 68015 | |||
| cda | 43582 | 35310 | 47482 | 51827 | 42743 | 56783 |
| wad | 60948 | 51730 | 75345 | |||
| wad | 44174 | 41289 | 46312 | |||
| wad | 51138 | 48701 | 61766 | |||
| wad | 41271 | 35053 | 45585 | 61555 | 60085 | 76922 |
- Anonymous7 years ago
Try unpivoting your table through the "Query Editor".
1. Edit table
2. Select column name "inst_name" and right click on the column header
3. Select "Unpivot Other Columns"
You'll get an "attribute" Column which will contain values such as your column headers (Year1_Median, Year1_P25, Year1_P75 etc.) and then a "Value" Column which will be the corresponding dollar amount.
Hopefully that helps!
Derek G
1 Reply
- AnonymousNot applicable
Try unpivoting your table through the "Query Editor".
1. Edit table
2. Select column name "inst_name" and right click on the column header
3. Select "Unpivot Other Columns"
You'll get an "attribute" Column which will contain values such as your column headers (Year1_Median, Year1_P25, Year1_P75 etc.) and then a "Value" Column which will be the corresponding dollar amount.
Hopefully that helps!
Derek G