Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It 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
User | Count |
---|---|
106 | |
89 | |
81 | |
76 | |
73 |
User | Count |
---|---|
112 | |
104 | |
96 | |
74 | |
66 |