Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago

Custom Number Formatting in Power BI Report Builder

Hi Team,

 

I am really frustrated and struggling to make one of the CHILD group numbers to be formatted as % while the rest of all should be in CURRENCY [$].

 

Here is the example where I am trying to format my last ROW where the row label is "Pct Difference" and the rest of the label rows should be formated as CURRENCY.

 

So far I have tried multiple Expressions but unable to get the desired results.

Few of the expressions I have tried till now;

1. =IIF(Fields!Child2.Value = "Pct Difference", FormatPercent(Fields!asset_curr.Value, "Dataset1",0), "Default")

2. =IIF(Fields!Child2.Value = "Pct Difference", FormatPercent(Fields!asset_curr.Value, "Dataset1"), '$'#,0.00;('$'#,0.00))

3. =IIF(Fields!Child2.Value = "Pct Difference", Format(Fields!asset_curr.Value, 0.00%), Format(Fields!asset_curr.Value,'$'#,0.00;('$'#,0.00)))

4. =IIF(Fields!Child2.Value = "Pct Difference", Format(Fields!asset_curr.Value,"P1"),"")

 

This is the expected output I am trying to achieve.

Please help

 

Thanks,

Ram

2 Replies

  • josef78's avatar
    josef78
    Memorable Member

    Hi,

    First, try ask in another formum: DAX commands and tips

     

    Second, I think is not good idea use multiple measures/scales in single column, better is design it with multiple measure columns (like Count, Amount, AmountDifference, AmountDifferencePct), but I do not know story behind it.

     

    But, in case when need format single column by different way you can use if, switch and format function. Also depends if you need row level value, or measure. If row level value it is easy

    IIF(Fields!Child2.Value = "Pct Difference", Format(Fields!asset_curr.Value, "0.00%"), Format(Fields!asset_curr.Value,"\$#,0.00"))

    If it is measure you can try:

    Solved: Re: DAX expression using specific field - Microsoft Power BI Community

  • Where are you setting this expression? If you just right click on the cell and edit the Expression you are setting the expression on the value property, But you can use expressions in almost all the properties in Report Builder. I woud suggest trying to set the Format property of the cell using an expression something like the following:

     

    =IIF(Fields!Child2.Value = "Pct Difference", "0,00%;-0.00%" , "$#,0.00;($#,0.00)")