cancel
Showing results for 
Search instead for 
Did you mean: 

Fabric is Generally Available. Browse Fabric Presentations. Work towards your Fabric certification with the Cloud Skills Challenge.

Reply
admin11
Memorable Member
Memorable Member

How to modify my expression to force Vari % return as % ?

Hi All

@VijayP have share with me Advanced Card , This Vis is must better then PBI Card Visulisation.

Because it can display more information in one card. 

 

When i try to use the below expression for display % Vari :-

 

_Vari_%_REV = if(isblank( divide(
[_YTD REV]
-
[_LYTD REV]
,
[_LYTD REV]
)),1, divide(
[_YTD REV]
-
[_LYTD REV]
,
[_LYTD REV]
))
 
Can some one share how to modify the above to force it display as %  ? Now it display as 12 decimal point.

admin11_0-1614418194046.png

https://www.dropbox.com/s/f6lsud321sdk2wr/PBT_V2021_339%20ask%20how%20to%20modify%20the%20expression...

Above is PBI file :-

1 ACCEPTED SOLUTION
mahoneypat
Microsoft
Microsoft

Select your measure in the Fields panel and then click on the % sign to format it as percent in the ribbon.  Also, you should write that measure using a variable to keep it from calculating twice each time.

 

_Vari_%_REV =
VAR vResult =
    DIVIDE (
        [_YTD REV] - [_LYTD REV],
        [_LYTD REV]
    )
RETURN
    IF (
        ISBLANK ( vResult ),
        1,
        vResult
    )

 
Pat




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

2 REPLIES 2
mahoneypat
Microsoft
Microsoft

Select your measure in the Fields panel and then click on the % sign to format it as percent in the ribbon.  Also, you should write that measure using a variable to keep it from calculating twice each time.

 

_Vari_%_REV =
VAR vResult =
    DIVIDE (
        [_YTD REV] - [_LYTD REV],
        [_LYTD REV]
    )
RETURN
    IF (
        ISBLANK ( vResult ),
        1,
        vResult
    )

 
Pat




Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


@mahoneypat Thank you very for sharing the right approach in writing expression. it is more structure.

Paul

Helpful resources

Announcements
PBI November 2023 Update Carousel

Power BI Monthly Update - November 2023

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

Community News

Fabric Community News unified experience

Read the latest Fabric Community announcements, including updates on Power BI, Synapse, Data Factory and Data Activator.

Power BI Fabric Summit Carousel

The largest Power BI and Fabric virtual conference

130+ sessions, 130+ speakers, Product managers, MVPs, and experts. All about Power BI and Fabric. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors