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 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?
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 |
---|---|
96 | |
93 | |
83 | |
70 | |
65 |
User | Count |
---|---|
118 | |
106 | |
93 | |
79 | |
72 |