Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

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]
Return
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

Capture.JPG

 

0 REPLIES 0

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors