Hi
I’m looking for helping writing a measure that selects a dynamic column based on slicer selection.
I have a large data set on power query that has hundreds of columns. I’m creating a dashboard where one of the slicers will be ‘dates’ allowing user to enter a from (start date) and to (end date). This would then filter the main data set and produce a subset data based on the user’s selection. A new column will then calculate percentage return ((end date/start date – 1)*100) over that period.
For visualization, this is how the data should look like
Main data
If user selects start date as 02/08/2020 and end date as 04/08/2020, a subset table will be generated as follows. The first column ("Portfolio") will be static but the two columns with dates will be dynamic based on user selection.
I would really appreciate your help in writing a measure that can do the above.
Thanks
B
I’m looking for helping writing a measure that selects a dynamic column based on slicer selection.
I have a large data set on power query that has hundreds of columns. I’m creating a dashboard where one of the slicers will be ‘dates’ allowing user to enter a from (start date) and to (end date). This would then filter the main data set and produce a subset data based on the user’s selection. A new column will then calculate percentage return ((end date/start date – 1)*100) over that period.
For visualization, this is how the data should look like
Main data
Portfolio | 31/07/2020 | 01/08/2020 | 02/08/2020 | 03/08/2020 | 04/08/2020 | 05/08/2020 |
P1 | 100.0 | 100.5 | 101.0 | 101.5 | 102.0 | 102.5 |
P2 | 100.0 | 101.0 | 102.0 | 103.0 | 104.0 | 105.0 |
P3 | 100.0 | 105.0 | 110.0 | 115.0 | 120.0 | 125.0 |
If user selects start date as 02/08/2020 and end date as 04/08/2020, a subset table will be generated as follows. The first column ("Portfolio") will be static but the two columns with dates will be dynamic based on user selection.
Portfolio | 02/08/2020 | 04/08/2020 | Return (%) |
P1 | 101.0 | 102.0 | 1.0 |
P2 | 102.0 | 104.0 | 2.0 |
P3 | 110.0 | 120.0 | 9.0 |
I would really appreciate your help in writing a measure that can do the above.
Thanks
B