Forum Discussion
DateDiff Days giving incorrect result
Hi,
Could you provide a little sample please? It's possible in your situation. Consider this: there should be one column which would be the primary column ( making the row unique). So there is only one [Next Reading Due By]. We can create a MEASURE like this:
Days =
IF (
MIN ( view_compliance[next reading due by] )
< MAX ( 'Report Generation Date Table'[ReportGeneration] ),
DATEDIFF (
MIN ( view_compliance[Next Reading Due by] ),
MAX ( 'Report Generation Date Table'[ReportGeneration] ),
DAY
),
0
)The report would like this with a slicer of [ReportGeneration]:
TheUniqueColumn [Next Reading Due by] Days
Please have a try.
Best Regards!
Dale
- Surendra_thota9 years agoHelper II
Hi Dale
I have tried as you said , atleast now we are not getting any issue but not giving correct answer , please see the attached screenshot , i took the report generation date as 1st jan 2017 ,
- v-jiascu-msft9 years agoMicrosoft Employee
Hi,
The result is correct in some way. It seems that you used the formula as a calculated column. So "MAX ( 'Report Generation Date Table'[ReportGeneration] )" is always the same. It's "2018-12-31" in your table. You have to use it as a measure if you want it to respond to the slicer. Finally, create a report with the measure. Please have a try.
Best Regards!
Dale