We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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?
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 56 | |
| 40 | |
| 36 | |
| 18 | |
| 18 |
| User | Count |
|---|---|
| 70 | |
| 67 | |
| 38 | |
| 34 | |
| 23 |