cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
RMDNA Senior Member
Senior Member

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

Accepted Solutions
Anonymous
Not applicable

Re: Changing value type within a measure just for display

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

Re: Changing value type within a measure just for display

Can you nest formats like such?

 

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

Hope this helps,

Parker

View solution in original post

RMDNA Senior Member
Senior Member

Re: Changing value type within a measure just for display

@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

Re: Changing value type within a measure just for display

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

 

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

Helpful resources

Announcements
Ask Amir Anything

Exclusive LIVE Community Event No. 2 – Ask Amir Anything

Next in our Triple A series: Ask Amir Netz questions about the latest updates, features and future.

October 2019 Community Highlights

October 2019 Community Highlights

October was a busy month in the community. Read the recap article to learn about some of the events and content.

New Solution Badges

New Solution Badges

Two waves of brand new solution badges are coming! Read the article for more information on our new community badges.

Analytics in Azure virtual event

Analytics in Azure virtual event

Experience a limitless analytics service built to ingest, prep, manage, and serve data for immediate use in Power BI.

Users Online
Currently online: 307 members 2,565 guests
Please welcome our newest community members: