Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hello All,
I have encountered a challenge.
I have a line chart that displays the daily values of metric selected. However some of the metrics are in "Number" format and some are in "Percentage". After adding the Metric column in the Chart it is all showing in numbers.
When a Metric which is in "Percent" format is chosen, the values are rounding off and showing 0 or 1.
Is it possible to display numbers when the respective metric is chosen and "%" when the corresponding metrics are selected?
Request your kind help.
Thanks
Hi @Anonymous ,
Has your problem been solved? If it is solved, you can mark the correct answer. If not, you can put forward your needs, and we can better help you solve it.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @Anonymous ,
It seems that it cannot be realized in the Line chart, but it can be realized in the table.
I created some data:
In the form, you can use the format() function:
Create measure:
Measure =
SWITCH(
TRUE(),
MAX('Table'[Group])="A",FORMAT(MAX('Table'[amount]),"Percent"),
MAX('Table'[Group])="B",FORMAT(MAX('Table'[amount]),"General Number"),
MAX('Table'[Group])="C",FORMAT(MAX('Table'[amount]),"General Number"),
MAX('Table'[Group])="D",FORMAT(MAX('Table'[amount]),"Percent")
)
When selecting A, the table shows the percentage:
When selecting B, the table displays decimals:
But in the Line chart, the Format() function is used to make the Measure a Text format and cannot be placed in the Value of the Line char.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi Liu,
@Anonymous
Thank you so much for the detailed information...
Let me try to implement this in my report.
Thanks
@Anonymous , You do that with the calculation groups, but you will need an external tool for that
calculation groups
https://www.sqlbi.com/blog/marco/2020/07/15/creating-calculation-groups-in-power-bi-desktop/
@amitchandak Thanks for the information.
However, since it is an external tool, I may not be able to install it on my office system. Hence is there any alternate solution?
| User | Count |
|---|---|
| 57 | |
| 43 | |
| 32 | |
| 16 | |
| 13 |
| User | Count |
|---|---|
| 84 | |
| 70 | |
| 38 | |
| 27 | |
| 24 |