Forum Discussion
Missing Percentage values
- 4 years ago
Hi, HamidBee
I made a mistake in the code, I have modified '__BASELINE_VALUE' to '__VALUE_TO_COMPARE'. You can check it.
I respect your decision, if you change your mind and have other problems, you can feel free to ask me. And
If my post helps, please consider Accept it as the solution to help the other members find it more quickly. Thank you.Best Regards,Community Support Team _ Janey
Hi, HamidBee
You haven't replied to me, I don't know if your problem has been solved.
I asked you before, not that the problem is difficult, but I don’t know what the result you want is, according to your code, logically it should be 0...
If your want is: when __BASELINE_VALUE is 0, the percentage increase shows __VALUE_TO_COMPARE, you can try Like this:
PD.Mixed =
VAR __BASELINE_VALUE =
SUM ( '2020'[Mixed] )
VAR __VALUE_TO_COMPARE =
SUM ( '2021'[Mixed] )
VAR percentage =
IF (
NOT ISBLANK ( __VALUE_TO_COMPARE ),
DIVIDE ( __VALUE_TO_COMPARE - __BASELINE_VALUE, __BASELINE_VALUE )
)
RETURN
IF ( percentage = BLANK (), __VALUE_TO_COMPARE, percentage )
Apologies, I've just bene drowning with work lately. I've given it some thought and I agree with you. From a mathematical point of view their is no numerical increase if the baseline value is zero. In all of my years working with numbers this is the first time I've come across this question. I'll leave it as it is for now, unless their is a way to put "null" if the baseline value is zero.
- v-janeyg-msft4 years ago
Community Support
Hi, HamidBee
I made a mistake in the code, I have modified '__BASELINE_VALUE' to '__VALUE_TO_COMPARE'. You can check it.
I respect your decision, if you change your mind and have other problems, you can feel free to ask me. And
If my post helps, please consider Accept it as the solution to help the other members find it more quickly. Thank you.Best Regards,Community Support Team _ Janey