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

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
Super User
Super User

@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
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.