March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Hi All
i have a custom column which calculates the length of service for leavers (Month date diff between start and end date)
then have another column which then divides the above by 12 to get years of service, ie 1.33 - i did have these rounded to do full years of service in a visual
The requirement has now changed to look something like the below - i just wanted thoughts on how the most efficient way of dealing with, is it a case of a long IF statement to return a number sequence linked to a new custom table?
TIA
David
Leavers | |
10 years + | 2 |
9-10 years | 1 |
8-9 years | 2 |
7-8 years | 3 |
6-7 years | 2 |
5-6 years | 3 |
4-5 years | 2 |
3-4 years | 5 |
2-3 Years | 5 |
1-2 years | 5 |
6-12 Months | 4 |
0-6 months | 5 |
Solved! Go to Solution.
@Anonymous , You can create a bucket like, a new column
New column=
var _diff = datediff([start date], [end date], month)/12c
Switch(true() ,
_diff <= .5 , " 0 - 6 Month",
_diff <= 1, " 6 - 12 Month",
_diff <=2 , " 1 -2 Years",
// Keep on additing other
)
@Anonymous , You can create a bucket like, a new column
New column=
var _diff = datediff([start date], [end date], month)/12c
Switch(true() ,
_diff <= .5 , " 0 - 6 Month",
_diff <= 1, " 6 - 12 Month",
_diff <=2 , " 1 -2 Years",
// Keep on additing other
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
123 | |
85 | |
85 | |
70 | |
51 |
User | Count |
---|---|
205 | |
157 | |
97 | |
79 | |
69 |