Forum Discussion
Anonymous
2 years agoNot applicable
Dynamically changing columns
Hi I have a requirement where I want to change my columns dynamically. Please refer the table below Partner 2024 Delivery 2023 Delivery 2022 Delivery a 10 25 30 b 30 35 20 c ...
- 2 years ago
hi Anonymous ,
Your data is not in the best format and it would be real pain to use the same table structure for data model. I would:
- select partner and then unpivot all other columns
-
- extract the year from the resulting attribute column
-
- load the query
- create a calculated column to get the max year as per the table and compare each row of year to the max year to return only those that are >=MaxYear-2 and use this calculated column as the filter.
-
Please see attached sample pbix for reference
danextian
2 years agoSuper User
hi Anonymous ,
Your data is not in the best format and it would be real pain to use the same table structure for data model. I would:
- select partner and then unpivot all other columns
-
- extract the year from the resulting attribute column
-
- load the query
- create a calculated column to get the max year as per the table and compare each row of year to the max year to return only those that are >=MaxYear-2 and use this calculated column as the filter.
-
Please see attached sample pbix for reference