Forum Discussion
Difference between two values in which one from Date column and another from measure date
Hi,
I am trying to display number of days between two dates :
I have date column in mytable and have created Independent Dimdate table and created slicer for Dimdate .
now i want to get datediff between [created date] column and selected date from date slicer.
| mytable[created date] | Dimdate[ date] | my output should be :no.of days=Dimdate-(created date) |
| 08-Oct-22 | 30-Nov-22 | 53 |
| 09-Nov-22 | 30-Nov-22 | 21 |
| 25-Nov-22 | 30-Nov-22 | 5 |
here Dimdate[date] is the selected date from filter.
can someone please help me to get this done
- Anonymous3 years ago
Hi Anonmous_user ,
Here are the steps you can follow:
1. Create measure.
Dim_select = MAXX(ALLSELECTED('Dimtable'),[Date])Measure = DATEDIFF( MAX('mytable'[Create date]), [Dim_select] ,DAY)2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
2 Replies
- AnonymousNot applicable
Hi Anonmous_user ,
Here are the steps you can follow:
1. Create measure.
Dim_select = MAXX(ALLSELECTED('Dimtable'),[Date])Measure = DATEDIFF( MAX('mytable'[Create date]), [Dim_select] ,DAY)2. Result:
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
- Anonmous_userNew Member
Thanks alot