Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

Chart to display percentage or number based on the metric chosen

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

 

5 REPLIES 5
Anonymous
Not applicable

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

Anonymous
Not applicable

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:

vyangliumsft_0-1636098624778.png

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:

vyangliumsft_1-1636098624781.png

When selecting B, the table displays decimals:

vyangliumsft_2-1636098624784.png

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.

vyangliumsft_3-1636098624784.png

 

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.

Anonymous
Not applicable

Hi Liu,

@Anonymous 

Thank you so much for the detailed information... 

Let me try to implement this in my report.

 

Thanks

amitchandak
Super User
Super User

@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/

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

@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?

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.