Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply

Custom FORMAT() thousand separator in a DAX measure

My region is set to Vietnam so that the thousand separator becomes "." and the decimal separator would be "," according to local conventions. For example, one thousand two hundred point zero two should show "1.200,02". However with the measure below, the Sales number would use normal separators "1,200.02" again.
Sales measure for card = IF(ISFILTERED(Dim_Date),FORMAT(([Sales]/1000000000), "#,##0 \billion\V\N\D;") & "         ", "Year not selected")
This is a total sales measure written specifically for card visuals (to add some space and for it to say "Year not selected" when no year is chosen). How do I format this for it to follow Vietnamese conventions again? Thanks.
 
1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @phuonganhtdinh ,

 

We can also change the measure as following to meet your requirement:

 

Update formula: consider it may have negative value, we use "@" as a temp char instead of previous "-"

 

Sales measure for card =
IF (
    ISFILTERED ( Dim_Date ),
    VAR sales =
        FORMAT ( ( [Sales] / 1000000000 ), "#,#.## \billion\V\N\D;" )
    RETURN
        SUBSTITUTE ( SUBSTITUTE ( SUBSTITUTE ( sales, ".", "@" ), ",", "." ), "@", "," ) & "         ",
    "Year not selected"
)

 

 

7.jpg


By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
TimoRiikonen
Advocate III
Advocate III

Try "Standard" format. Although this format is not visible in the list by default, you can still overwrite it as the display format.

For integers use custom format #,0.

v-lid-msft
Community Support
Community Support

Hi @phuonganhtdinh ,

 

We can also change the measure as following to meet your requirement:

 

Update formula: consider it may have negative value, we use "@" as a temp char instead of previous "-"

 

Sales measure for card =
IF (
    ISFILTERED ( Dim_Date ),
    VAR sales =
        FORMAT ( ( [Sales] / 1000000000 ), "#,#.## \billion\V\N\D;" )
    RETURN
        SUBSTITUTE ( SUBSTITUTE ( SUBSTITUTE ( sales, ".", "@" ), ",", "." ), "@", "," ) & "         ",
    "Year not selected"
)

 

 

7.jpg


By the way, PBIX file as attached.


Best regards,

 

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Great answer @v-lid-msft

I've been searching for this solution for a while. It is a witty one. Thanks for sharing 😉

nandukrishnavs
Community Champion
Community Champion

@phuonganhtdinh 

 

Check out this video 

 

Documentation: https://docs.microsoft.com/en-us/power-bi/desktop-custom-format-strings

 



Did I answer your question? Mark my post as a solution!
Appreciate with a kudos
🙂

 

 


Regards,
Nandu Krishna

Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

Check out the February 2024 Power BI update to learn about new features.

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors