Forum Discussion
johankent30
Helper I
7 years agoDAX Variable Date Column
I am trying to create a column in power bi that will change based on a slicer selection. For example, let's say that I have the table below: Date | Column A | Column B
1/1/2019 ...
- Anonymous7 years ago
One possibility:
1. Store the Date +A as one Calculated Column, Date +B as s second Calculated column
2. Create a disconnected Parameters table, with column Add Type.
3. Create a measure like this: (You could do the date math in the measure, but I find it cleaner to do it this way and it may improve performance.)
Date Picker = IF( SELECTEDVALUE('Parameters'[Add Type]) = "A", MAX(<yourtable>[DateA]), MAX(<yourtable>[DateB]) )
Anonymous
7 years agoNot applicable
One possibility:
1. Store the Date +A as one Calculated Column, Date +B as s second Calculated column
2. Create a disconnected Parameters table, with column Add Type.
3. Create a measure like this: (You could do the date math in the measure, but I find it cleaner to do it this way and it may improve performance.)
Date Picker =
IF(
SELECTEDVALUE('Parameters'[Add Type]) = "A",
MAX(<yourtable>[DateA]),
MAX(<yourtable>[DateB])
)