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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
powertechbi
Frequent Visitor

Formatting table values

Goodnight.

I have a question, thank you in advance for your attention.
Anyway, I'm creating a table that will show results per month from 4 measures: revenue, cost, profit and quantity sold. I want to switch between absolute and percentage values. I created the formulas, which are working for me, the problem is that the values ​​are not appearing in the graph with the formatting. I need the absolute values ​​to be: R$ before the value and the percentage values ​​to have the % symbol at the end of the values.
Any suggestions on how I can do it?
I'm adding images of the dashboard.
Again, thank you.duvida3.jpgduvida2.jpg

4 REPLIES 4
powertechbi
Frequent Visitor

@ahadkarimi 

 

I try used this, but I tried to do as you suggested, but as shown in the image below, the columns and values ​​disappear in the chartduvida 4.jpg

Hi @powertechbi ,

 

This is because this measure outputs text, and Bar chart cannot accept text values.

You can still use the previous formula in the Bar chart. Then use this format measure here.

vcgaomsft_0-1724635821882.png

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly.
If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

lbendlin
Super User
Super User

you need to use FORMAT to convert the number into the desired text format. Note that this will mess with the sort order.   Please watch the August 2024 announcement about Visual Calculations formatting - that will likely help in your scenario  (when combined with Field Parameters)

ahadkarimi
Solution Specialist
Solution Specialist

Hi @powertechbi, give this a try, and if you encounter any issues, let me know.

 

Formatted Value = 
VAR _SelectMedida = SELECTEDVALUE(Select1[Select1 Pedido])
VAR _SelectTipoValor = SELECTEDVALUE(Tipo[Tipo Pedido])
VAR _Resultado = SWITCH(
    TRUE(),
    _SelectMedida = 0 && _SelectTipoValor = 1, [Receita Total], 
    _SelectMedida = 0 && _SelectTipoValor = 0, FORMAT([Receita % Mês] * 100, "0.00 %"),
    _SelectMedida = 1 && _SelectTipoValor = 1, [Lucro Total], 
    _SelectMedida = 1 && _SelectTipoValor = 0, FORMAT([Lucro % Mês] * 100, "0.00 %"),
    _SelectMedida = 2 && _SelectTipoValor = 1, [Custo Total], 
    _SelectMedida = 2 && _SelectTipoValor = 0, FORMAT([Custo % Mês] * 100, "0.00 %"),
    _SelectMedida = 3 && _SelectTipoValor = 1, [Quantidades Vendidas], 
    _SelectMedida = 3 && _SelectTipoValor = 0, FORMAT([Quantidade % Mês] * 100, "0.00 %")
)
RETURN
IF(_SelectTipoValor = 1, FORMAT(_Resultado, "R$ #,##0.00"), _Resultado)

 

 

Did I answer your question?  If so, please mark my post as the solution!
Your Kudos are much appreciated!  Proud to be a Resolver IV !

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.