Forum Discussion
DateDiff Days giving incorrect result
That is super weird, and I am mostly commenting just so I can follow along :D
My only thought would be to try to wrap CALCULATE( ) around your call to DATEDIFF.
- Surendra_thota9 years ago
Helper II
Hi Scottsen
when i use today() function i am getting correct value
Days Due = View_Compliance[Next Reading Due By]- Today()
but when i want use a constant date ie selected from input slicer , it is nota accepting , even i tried to give max reportiondate as measure as well directly as shown below but bothcases it is taking only last value of the genetation date table value but not slected value.
Days Due Column = View_Compliance[Next Reading Due By]- MAX('Report Generation Date Table'[Report Generation Date])
How to pass a slected date value from slicer used in difffrent table as variable
- Anonymous9 years agoNot applicable
* I'm curious what the relationship is between View_Compliance and 'Report Generation Date Table' tables. I didn't catch before these were from different tables, and you might just need to use the RELATED( ) function for 1 of your columns.
* You mention a "slicer" -- note those will NOT impact a calculated column in any way. Only measures are impacted by slicers. Likely you can write a "Total Difference" measure that aggregates the difference from each line.
- Surendra_thota9 years ago
Helper II
Hi Scottsen.
There is no relation between those 2 tables , I just took report generation table to get date input from user ie linked slicer , then I am creating measure by taking that date. I want to use that measure in view_compliance to due dates . Is there any other way to achieve user input date to calculate datediff on each row