Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
I have have table like this.
Now I wan't to create a measure as Days Vacant. In which I wan't to show no.of days that IteamAreaID has been vacant. If IteamAreaID 10 and ContractEndate is "Thursday, December 09, 2021" and again ContractStartDate is "Friday, December 10, 2021" for IteamAreaID 10 now in Days vacant measure I wan't to show as '0' because the days difference between those two dates are '0' and suppose if new ContractStartDate is "Wednesday, December 15, 2021" then Days vacant I wan't to show as '4'. For this how write dax. @Ashish_Mathur
Solved! Go to Solution.
@Anonymous , Try like
var _1 = datediff(maxx(filter(Table, [IteamAreaID] = earlier([IteamAreaID]) && [ContractEndate]< earlier([ContractStartDate])),[ContractEndate]), [ContractStartDate],day)-1
return if( _1 =-1, 0, _1)
I'm getting an error as "Parameter is not the correct type"
@Anonymous , Sorry my mistake use datediff
datediff(maxx(filter(Table, [IteamAreaID] = earlier([IteamAreaID]) && [ContractEndate]< earlier([ContractStartDate])),[ContractEndate]), [ContractStartDate],day)-1
When an IteamAreaID appearing for 1st time it showing '-1' value. I wan't it as '0'.
I want to show results like this
@Anonymous , Try like
var _1 = datediff(maxx(filter(Table, [IteamAreaID] = earlier([IteamAreaID]) && [ContractEndate]< earlier([ContractStartDate])),[ContractEndate]), [ContractStartDate],day)-1
return if( _1 =-1, 0, _1)
@Anonymous , Try a new column
dateadd(maxx(filter(Table, [IteamAreaID] = earlier([IteamAreaID]) && [ContractEndate]< earlier([ContractStartDate])),[ContractEndate]), [ContractStartDate],day)-1
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Ask questions in Eventhouse and KQL, Eventstream, and Reflex.
User | Count |
---|---|
86 | |
84 | |
66 | |
62 | |
59 |
User | Count |
---|---|
197 | |
116 | |
107 | |
77 | |
70 |