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.
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!
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 |
---|---|
113 | |
100 | |
78 | |
76 | |
52 |
User | Count |
---|---|
144 | |
109 | |
108 | |
88 | |
61 |