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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
yves007
Frequent Visitor

how to format the unit of the measure of selected measures in a visual chart

i  have created this measure 

Selected items = if (
HASONEVALUE('Measure selection'[Measure ]),
Switch(
   VALUES ('Measure selection'[Measure ]),
           "Month to Month % change", [MOM_I],
           "Price Index", [Index_I],
           "Year over Year % change", [YOY_I]))
but now i want to format the MOM in the percentage and YOY also in the percentage and leave Price index as it in this measure 
1 ACCEPTED SOLUTION

Hi @yves007 

This seems to be the only solution.
Also, I use it regularly, so it has to work.

 

Here's an example I gave you. Let's try to figure out where things went wrong.

In any case, you can download a sample file from here in addition to the explanation below: Link to file

 

Using a sample file with a table, I built a small table for selecting metrics.

Ritaf1983_0-1684551852193.png

I have just built 3 measures for logical numeric results in:

Ritaf1983_1-1684551967341.png

As I suggested, I wrapped your formula in a format function

Selected items = if (
HASONEVALUE('KPI''S'[KPI]),
Switch(
   VALUES ('KPI''S'),
           "Percent", FORMAT([test_percent 1],"percent"),
           "Number",FORMAT( [TestNumber 1],"#,##0"),
           "curency", format([TestCurre1],"$#,##0")))
Ritaf1983_3-1684552177296.png

Finally, I checked the results using a small kpis table in Slicer and on simple table.
It works perfectly.

Ritaf1983_4-1684552329368.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly



Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

View solution in original post

3 REPLIES 3
Ritaf1983
Super User
Super User

Hi @yves007 
Put the desired result in a function
"format"
Depending on your needs, you can choose any format
Something like : 

Selected items = if (
HASONEVALUE('Measure selection'[Measure ]),
Switch(
   VALUES ('Measure selection'[Measure ]),
           "Month to Month % change",  format ([MOM_I],""Percent")
     ....
 
If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

it didnt work, is there another way?

Hi @yves007 

This seems to be the only solution.
Also, I use it regularly, so it has to work.

 

Here's an example I gave you. Let's try to figure out where things went wrong.

In any case, you can download a sample file from here in addition to the explanation below: Link to file

 

Using a sample file with a table, I built a small table for selecting metrics.

Ritaf1983_0-1684551852193.png

I have just built 3 measures for logical numeric results in:

Ritaf1983_1-1684551967341.png

As I suggested, I wrapped your formula in a format function

Selected items = if (
HASONEVALUE('KPI''S'[KPI]),
Switch(
   VALUES ('KPI''S'),
           "Percent", FORMAT([test_percent 1],"percent"),
           "Number",FORMAT( [TestNumber 1],"#,##0"),
           "curency", format([TestCurre1],"$#,##0")))
Ritaf1983_3-1684552177296.png

Finally, I checked the results using a small kpis table in Slicer and on simple table.
It works perfectly.

Ritaf1983_4-1684552329368.png

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly



Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors