cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Resolver I

## DAX measure omitting the first decimal place when zero.

Morning everyone, hope you are keeping well

@amitchandak gave me a great measure to force the display of revenue to different decimal places when it's millions or thousands.

I've found an issue though. I have a tile displaying total revenue for a given period. This month's value is 1.02 million. The title only shows £1.m it's not including the 0.

``YtdActRev = IF([YTD_ActualRevenue]>1000000,FORMAT(ROUND([YTD_ActualRevenue]/1000000,1),"£#.#m"),FORMAT(ROUND([YTD_ActualRevenue]/1000,0),"£#k"))``

Any ideas?

1 ACCEPTED SOLUTION
Community Support

Hi @aTChris ,

It is by design.

 ( # ) Digit placeholder. Display a digit or nothing. If the expression has a digit in the position where the # appears in the format string, display it; otherwise, display nothing in that position. This symbol works like the 0 digit placeholder, except that leading and trailing zeros aren't displayed if the number has the same or fewer digits than there are # characters on either side of the decimal separator in the format expression.

Reference:

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings#supported-cus...

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
4 REPLIES 4
Super User

@aTChris , the round is rounding to 1 decimal place. change it to 2

ROUND([YTD_ActualRevenue]/1000000,1)

Resolver I

@amitchandak it's supposed to be 1decimal place, which should, therefore, display £1.0m

The value it's working with is 1,022,934

with the below, it displays £1.m

``FORMAT(ROUND([YTD_ActualRevenue]/1000000,1),"£#.#m"``

with the below, it displays £1.m

``FORMAT(ROUND([YTD_ActualRevenue]/1000000,2),"£#.#m"``

with the below, it displays £1.02m, which I would expect

``FORMAT(ROUND([YTD_ActualRevenue]/1000000,2),"£#.##m"``

I just don't understand why it's not showing the zero when set to 1 decimal place.

Thanks

Community Support

Hi @aTChris ,

It is by design.

 ( # ) Digit placeholder. Display a digit or nothing. If the expression has a digit in the position where the # appears in the format string, display it; otherwise, display nothing in that position. This symbol works like the 0 digit placeholder, except that leading and trailing zeros aren't displayed if the number has the same or fewer digits than there are # characters on either side of the decimal separator in the format expression.

Reference:

https://docs.microsoft.com/en-us/power-bi/create-reports/desktop-custom-format-strings#supported-cus...

Best Regards,
Xue Ding
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Resolver I

thank you, I understand now.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.