Showing results for 
Search instead for 
Did you mean: 
Helper III
Helper III

Date DIfference from current selection.

Hey Guys,

I am stuck with a new a problem now.

So i have a list of vehicles which has a column "active from"-From which date the vhicle is active 
and "completion"-its just 6 months after the" active from" date.

Objective-When a user select a date range ,so first we have to check if any of the vehicle's  completions date is falling under that date range.

IF Yes then we have to calculate the difference between last date of selection with the vehicle's completion date.Then that difference will be divided by30.


Contains = IF(CONTAINS(vehiclecount,ehiclecount[Completion Date],[selected_Date]),1,0) 


Returns me if the vehicles completion date is under selection


Measure = 
Var conta =[Contains]
CALCULATE(DATEDIFF(MIN(vw_vehiclecount[6 Months Completion]),[selected_Date],DAY),FILTER(vw_vehiclecount,conta=1))/30


This gives me the total and divided by 30.
But i total is coming our wrong




Helpful resources

PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Get Ready for Power BI Dev Camp

Power BI Dev Camp - June 24th

Mark your calendars and join us for our next Power BI Dev Camp!

Top Solution Authors
Top Kudoed Authors