Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi All
I wonder if someone could help me out with a challenge I'm facing. Im calculating pro-rate annual leave and need to round the result up to the nearest 0.5.
My column looks like this
= Table.AddColumn(#"Changed Type2", "Pro-Rata", each ([Allowance]/12)*[Months Elapsed],Int64.Type)
and I was hoping there's something I can do to get e.g. 2.25 to round to 2.5, or 3.17 to round to 3.5 etc.
Thanks for all the suggestions. I ended up going down a route I used in Excel many years ago.
Rounded up 2 x the number and then divided it by 2. Seems to work perfectly. I did expect there to be a CEILING/FLOOR type function but aparently not. No matter, I think the method I've used does the job.
Hope this helps though this may not be the most efficient way:
Thank you, that does work. I wanted to go on and use that rounded number in another custom column but I'm not sure that I can to that having added a column in this way. Is there a way to use Custom Column in Transform Data to acheive same?
you can try this in PQ
= Table.AddColumn(#"Changed Type", "Custom", each Number.RoundUp([Column1]/0.5)*0.5)
Proud to be a Super User!
@Anonymous
you can try this
Column = CEILING('Table'[Column1],0.5)
Proud to be a Super User!
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |