Forum Discussion
Herchris7172
2 years agoRegular Visitor
DAX | Date Diff
Hello Team Need your help on the below I have 2 Tables, one includes Dates, Revised Due Date Second is a Calender table Used to define my Selected-Date=SelectedValue(Calender[Date]) Ne...
- Anonymous2 years ago
Hi Herchris7172 ,
Here are the steps you can follow:
1. Create measure.
Measure = var _select=SELECTEDVALUE('Calender'[Date]) var _if= IF( MAX('Table'[Revised Due Date]) = BLANK(), DATEDIFF( MAX('Table'[Date]),_select,DAY), DATEDIFF( MAX('Table'[Revised Due Date]),_select,DAY)) return DIVIDE(ABS(_if) ,30)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
Anonymous
2 years agoNot applicable
Thanks for the reply from lbendlin , please allow me to provide another insight:
Hi Herchris7172 ,
Here are the steps you can follow:
1. Create measure.
Test =
var _select=SELECTEDVALUE('Calender'[Date])
var _table=
ADDCOLUMNS(
ALL('Table'),"Datediff",
IF(
'Table'[Revised Due Date] = BLANK(),
DATEDIFF(
'Table'[includes Dates],_select,MONTH),
DATEDIFF(
'Table'[Revised Due Date],_select,MONTH)))
return
SUMX(
_table,[Datediff])
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
Herchris7172
2 years agoRegular Visitor
Thanks for the Reply but am Expecting results like the below. This is in Excel