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
Anonymous
Not applicable

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.

ram_ram_0-1612009408302.png

Please help

 

Thanks,

Ram

2 REPLIES 2
d_gosbell
Super User
Super User

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)")

josef78
Memorable Member
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

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.