Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
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
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
107 | |
93 | |
77 | |
65 | |
53 |
User | Count |
---|---|
147 | |
106 | |
104 | |
87 | |
61 |