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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
johnyip
Solution Sage
Solution Sage

Need help in formatting thousand separator and decimal points using FORMAT()

Hello all,

 

I tried to use a DAX like FORMAT([a measure],"#,###.####") to control the display of a measure value as having a thousand separator and 4 decimal places.

 

This DAX is working fine except when the measure is actually an integer, an unnecessary trailing dot appears, as the follow picture.

 

johnyip_0-1689662015167.png

 

I would be grateful if anyone can provide a DAX expression that can elminiate that trailing dot but retaining the setting of 4 decimal places and thousand separator. Thanks.

 



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!
1 ACCEPTED SOLUTION
johnyip
Solution Sage
Solution Sage

I just found a twisted way to achieve this:

 

IF(INT([measure])=[measure)],FORMAT([measure],"#,##0"),FORMAT([measure],"#,##0.####"))
 
But I am really not sure if this is the best way to do that,as this seems stupid. Please tell me if there is a smarter way.





Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

View solution in original post

2 REPLIES 2
johnyip
Solution Sage
Solution Sage

I see there are no further replies, and I assume my twisted way is the only way to achieve my desired outcome under the current version og PowerBI.



Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!
johnyip
Solution Sage
Solution Sage

I just found a twisted way to achieve this:

 

IF(INT([measure])=[measure)],FORMAT([measure],"#,##0"),FORMAT([measure],"#,##0.####"))
 
But I am really not sure if this is the best way to do that,as this seems stupid. Please tell me if there is a smarter way.





Please mark my post as the solution if this answers your question!
Appreciate your Kudos !!

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

Find out what's new and trending in the Fabric community.