Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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?
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 40 | |
| 38 | |
| 33 | |
| 29 | |
| 26 |
| User | Count |
|---|---|
| 131 | |
| 105 | |
| 60 | |
| 56 | |
| 55 |