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
yforti
Helper II
Helper II

Help with dax and unichar

Is it possible to show the result with unichar in a single measurement?

I tried this:

yforti_1-1738354200396.png

 

but the result was this:

yforti_0-1738354141834.png

however I need the value in percentage: -9,42% and unichar code

1 ACCEPTED SOLUTION

Glad to hear you've solved the main issue.

The latest problem looks to be due to blank values of x falling into the 2nd branch of IF.

 

I suggest adjusting your measure to return a blank result when x is blank.

Here is how you could write it:

Variação Média CNE180 =
VAR vVariacao = [m_CNE180] - [6M CNE180]
VAR x =
    DIVIDE ( vVariacao, [6M CNE180], 0 )
RETURN
    IF (
        NOT ISBLANK ( x ),
        IF (
            x < 0,
            FORMAT ( x, "0.00%" ) & UNICHAR ( 9989 ),
            FORMAT ( x, "0.00%" ) & UNICHAR ( 10060 )
        )
    )

 

An alternative you may want to look at is to leave your measure as this:

Variação Média CNE180 =
VAR vVariacao = [m_CNE180] - [6M CNE180]
VAR x =
    DIVIDE ( vVariacao, [6M CNE180], 0 )
RETURN
    x

but give it this custom format string:

0.00%\;0.00%\;0.00%\

OwenAuger_0-1738486983075.png

See here:

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings#add-a-model-...

 

Does one of the above methods work for you?

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

View solution in original post

3 REPLIES 3
OwenAuger
Super User
Super User

Hi @yforti 

You can use the FORMAT function to return a value with a specific number format as text.

In this case, you could change the final expression to

 

FORMAT ( x, "0.00%" ) & UNICHAR ( 10004 )

 

 

I would also suggest considering leaving the measure as a number, but using a format string to control the formatting (possibly a dynamic format string).

For example, a simple format string for negative values could be:

"0.00%\✔"

Here's a good article on this subject:

https://www.sqlbi.com/articles/improving-data-labels-with-format-strings/

 

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Thnks man! It worked!

The only problem is:
before with the measurement as shown in the photo, it only brought the relevant values->

yforti_0-1738481939180.png

 

, now with the change in measurement, it is bringing values ​​to all lines->

yforti_1-1738481966466.png

Can u help me?

Glad to hear you've solved the main issue.

The latest problem looks to be due to blank values of x falling into the 2nd branch of IF.

 

I suggest adjusting your measure to return a blank result when x is blank.

Here is how you could write it:

Variação Média CNE180 =
VAR vVariacao = [m_CNE180] - [6M CNE180]
VAR x =
    DIVIDE ( vVariacao, [6M CNE180], 0 )
RETURN
    IF (
        NOT ISBLANK ( x ),
        IF (
            x < 0,
            FORMAT ( x, "0.00%" ) & UNICHAR ( 9989 ),
            FORMAT ( x, "0.00%" ) & UNICHAR ( 10060 )
        )
    )

 

An alternative you may want to look at is to leave your measure as this:

Variação Média CNE180 =
VAR vVariacao = [m_CNE180] - [6M CNE180]
VAR x =
    DIVIDE ( vVariacao, [6M CNE180], 0 )
RETURN
    x

but give it this custom format string:

0.00%\;0.00%\;0.00%\

OwenAuger_0-1738486983075.png

See here:

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings#add-a-model-...

 

Does one of the above methods work for you?

 


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
LinkedIn

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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