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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
RMDNA
Solution Sage
Solution Sage

Changing value type within a measure just for display

Hi all,

 

I'm creating in-table KPIs using a mesaure in order to add a colored box inside the cell (and avoid the full-cell color background).

 

Spoiler
x.PNG

The measure to create this visual is below:

 

Spoiler
New Accounts_WTD % #/KPI =
VAR Indicator =
    IF (
        [New Accounts_PL % WTD] >= 1.1,
        UNICHAR ( 128215 ),
        IF (
            [New Accounts_PL % WTD] < 0.9,
            UNICHAR ( 128213 ),
            IF ( [New Accounts_PL % WTD] >= 0.9UNICHAR ( 128210 )UNICHAR ( 128211 ) )
        )
    )
RETURN
    IF (
        [New Accounts_PL % WTD] <> 0,
        FORMAT ( [New Accounts_PL % WTD] & " " & Indicator0 ),
        0
    )

 

As you can see from the picture, the values are displayed as a number - what I need is to get it to display as a %. The measure is set to display as a %, the field referenced in the calculation is a %, and it's set to % in Field Formatting, but it always stays as a number.

 

Is it possible to set the output format within the measure, or will it always default to a number?

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Can you nest formats like such?

 

FORMAT ( FORMAT([New Accounts_PL % WTD],"Percent") & " " & Indicator, 0 )

Hope this helps,

Parker

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Can you nest formats like such?

 

FORMAT ( FORMAT([New Accounts_PL % WTD],"Percent") & " " & Indicator, 0 )

Hope this helps,

Parker

@Anonymous,

 

That seems to work (at least in initial testing); is there a way to specify how many decimals places are used?

Anonymous
Not applicable

I've never done it but apparently it can be done with the FIXED function.

 

FIXED(<number>, <decimals>, <no_commas>)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.