Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
I am sharing the table screenshot where there are column name date and hire date so I am trying to get the tenure day through that but I am not able to understand the logic of the calculated Dax formula for this, I am sharing the formula can someone explain me this that how this logic work
Solved! Go to Solution.
@mahendrapal1792 can you try this
Tenure Days = CONVERT(IF([date]-[HireDate]<0,[HireDate]-[date],[date]-[HireDate]),INTEGER)
smpa01’s answer is correct , Since your original formula subtracts two dates and returns a date type, you need to use the convert function to make it an integer type.
There is another method you can use to get the same result.
You can use the DATEDUFF function, this function returns the number of units (unit specified in Interval) between the input two dates.
The formula is as follows
TenureDays = DATEDIFF([data],[HireData],DAY)
Best Regards,
Jayleny
smpa01’s answer is correct , Since your original formula subtracts two dates and returns a date type, you need to use the convert function to make it an integer type.
There is another method you can use to get the same result.
You can use the DATEDUFF function, this function returns the number of units (unit specified in Interval) between the input two dates.
The formula is as follows
TenureDays = DATEDIFF([data],[HireData],DAY)
Best Regards,
Jayleny
@mahendrapal1792 can you try this
Tenure Days = CONVERT(IF([date]-[HireDate]<0,[HireDate]-[date],[date]-[HireDate]),INTEGER)
Can you explain how this formula works?
User | Count |
---|---|
97 | |
87 | |
76 | |
67 | |
63 |
User | Count |
---|---|
112 | |
96 | |
95 | |
67 | |
65 |