Forum Discussion
GustavoBorges
3 years agoFrequent Visitor
DATEDIFF returning incorrect value inside a DATEADD function
I want to plot some measurements on a line chart. Measures refer to the period selected in a filter on the page. Then the measure referring to the value of the selected date is plotted, the measure...
v-chenwuz-msft
3 years agoCommunity Support
Hi GustavoBorges ,
I think the var lead to the wrong result. Please note that the var will ignore any filters when you do some filter to it under "return".
Change the Dias_entre_datas like this:
Dias_entre_datas =
DATEDIFF(LASTDATE(dCalendario[Date]), PREVIOUSDAY(FIRSTDATE(dCalendario[Date])), DAY)
Best Regards
Community Support Team _ chenwu zhu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
GustavoBorges
3 years agoFrequent Visitor
The same here
Criados P-1 = CALCULATE(
[total_negocios],
DATESBETWEEN(dCalendario[Date], LASTDATE(DATEADD(dCalendario[Date], [Dias_entre_datas], DAY)), PREVIOUSDAY(dCalendario[Date]))
)