Forum Discussion
Dynamic Column based on slicer
I have a table with a sales date (per order) and then a disconnected date table. I would like to be able to calculate a dynamic aging based on the slicer selection.
For example, sales order date is 6/07/2019, if i select 6/11/2019, the column would calculate 4. If i select 6/09/2019, the column would calculate 2.
Is there any way to do this?
Does this answer look close to what you want? https://community.powerbi.com/t5/Desktop/Dynamic-Column-Calculation-Based-on-Multiple-Slicers/td-p/107480
If so, you can use their answer, but instead of summing the values, you should be able to use something like this:
MONTHDIFF = CALCULATE (DATEDIFF(Table1[OrderDate], EARLIEST(Table2[SelectedDate]), month ), ALLSELECTED () )
Set your slicer to select values from your independant date table, and you should be good to go.
6 Replies
- CmcmahanResident Rockstar
Does this answer look close to what you want? https://community.powerbi.com/t5/Desktop/Dynamic-Column-Calculation-Based-on-Multiple-Slicers/td-p/107480
If so, you can use their answer, but instead of summing the values, you should be able to use something like this:
MONTHDIFF = CALCULATE (DATEDIFF(Table1[OrderDate], EARLIEST(Table2[SelectedDate]), month ), ALLSELECTED () )
Set your slicer to select values from your independant date table, and you should be good to go.
- CmcmahanResident Rockstar
What happens when you just type in the column manually? Do you get an error message?
I've found that sometimes the autocomplete doesn't fill in, but you can still accomplish the task.