Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone,
I am trying to introduce conditional formatting for my percentage value in order to better show whether our various sales figures have increase or decreased. In order to do that, I would like to keep the + sign before the percentage value. See the example below:
As you can see, the percentage value of International Sales and All Sales are behaving as intendend i.e. - sign to show that International Sales have decreased by 18%, + sign to show that All Sales have increased by 6%. However, when sales remain flat, I am unable to have only a 0 shown in front of my percentage value as can be seen above.
I have my percentage measure formatted as follows:
The dax for my measure does not contain any further formatting code:
CM %delta Our Sales =
var cyOurSales=
[CM CY Sales]
var pyOurSales=
[CM PY Sales]
var div=
SWITCH(
TRUE(),
ISBLANK(cyOurSales)&&ISBLANK(pyOurSales),
BLANK(),
cyOurSales = 0,
-1,
DIVIDE(
cyOurSales,
pyOurSales,
BLANK()
) -1
)
return div
Does anyone know why PowerBI is not working as expected. What can I do in order to have the measure format the values as desired i.e. +5%, 0%, -5%?
Solved! Go to Solution.
Hi , @ThomasSan
According to your description, you use the "+#%;-#%;0%" in the format of the measure , but it returns the "+%" in your visual , and you want to show the "0%" for it .
I test it in my side , it may be caused by the measure value is very small but it is a positive number,like this:
This is the "+#%;-#%;0%" judgement just have three conditions: Positive number, negative number and 0.
If you want to when the measure return value is very small you can add a logic in your measure to return 0:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi , @ThomasSan
According to your description, you use the "+#%;-#%;0%" in the format of the measure , but it returns the "+%" in your visual , and you want to show the "0%" for it .
I test it in my side , it may be caused by the measure value is very small but it is a positive number,like this:
This is the "+#%;-#%;0%" judgement just have three conditions: Positive number, negative number and 0.
If you want to when the measure return value is very small you can add a logic in your measure to return 0:
Thank you for your time and sharing, and thank you for your support and understanding of PowerBI!
Best Regards,
Aniya Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi! Yes, the problem appears for digits that are being rounded down. It is baffeling to me that when a value is being rounded down to a 0 value, the displayed value is not picking up the formatting for a 0 value.
However, your solution was helpful in displaying 0 values as desired! Thanks you
User | Count |
---|---|
73 | |
70 | |
38 | |
24 | |
23 |
User | Count |
---|---|
96 | |
93 | |
50 | |
41 | |
40 |