Forum Discussion
Dax Week Calculation - Power BI
- 3 years ago
Hi RenanPNog ,
Based on your DAX expression and your requirements description, you want to avoid rounding values like "30.85714" and instead round down, right? If this is the case, I recommend that you nest a round-down function RoundDown () in DAX outside when outputting the value of this week, you can refer to this official documentation.
ROUNDDOWN function (DAX) - DAX | Microsoft Learn
Best Regards,
Neeko Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- RenanPNog3 years agoHelper I
Hi, Anonymous .
Unfortunatelly, i don't think ROUNDDOWN function will solve my issue...whenever i use a round function, it will only cut my decimals and won't resolve it...
I've pasted another picture, for example:
Week 31 starts in 26/10, and value is 31,71429. My correct last day of week 31 is 02/11, and the final result gives me 30,71429, the next one (that i want to round down) is 30,57143.
If i set the rounddown function, it will turn this "30,57143" to 31, and that's not what i want.
I noticed this pattern, that every time it gives me this decimal "0,71429" i want to round up, other wise, round down.
E.G (expected result)
day current Value expected result26/10 31,71429 31
27/10 31,57143 31
28/10 31,42857 31
29/10 31,28571 31
30/10 31,14286 31
31/10 31,00000 31
01/11 30,85714 31
02/11 30,71429 30
03/11 30,57143 30
04/11 30,42857 30
05/11 30,28571 30
06/11 30,14286 30
07/11 30,00000 30
08/11 29,85714 30
09/11 29,71429 29
10/11 29,57143 29