Forum Discussion
ianallen13
Helper I
3 years agoPower BI Question: Rounding up or down based on tenths place
Hello, I have a request where the end-user is asking for averages of numbers for each term (easy enough), but then wants each term average then calculated and rounded either up or down based on ...
Greg_Deckler
Community Champion
3 years agoianallen13 So ROUND is going to round .5 up so if you want to instead round based on .5 rounding down and .51 rounding up then perhaps something like this:
Rounded Average =
VAR __Average = [Average] //your average measure
VAR __Trunc = TRUNC( __Average )
VAR __Decimal = __Average - __Trunc
VAR __Result = IF( __Decimal > .5, __Trunc + 1, __Trunc )
RETURN
__Result