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

Get inspired! Check out the entries from the Power BI DataViz World Championships preliminary rounds and give kudos to your favorites. View the vizzies.

Reply
murali_r
Helper I
Helper I

how do we remove decimal places if the column value has whole number else display decimal places?

I have both whole number and decimal values in single column . I want to display as it is (whole number should display same and decimal number should display two decimal places) . But by default it displays always two decimal places even if it is whole number . How do I acheive it ?

Please update any one knows.

1 ACCEPTED SOLUTION
Greg_Deckler
Super User
Super User

You could potentially do something like:

 

Measure 3 = IF(MOD(SUM(Budgets[Value]),2)=0,FORMAT(SUM(Budgets[Value]),"#####"),FORMAT(SUM(Budgets[Value]),"####.##"))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

3 REPLIES 3
Greg_Deckler
Super User
Super User

You could potentially do something like:

 

Measure 3 = IF(MOD(SUM(Budgets[Value]),2)=0,FORMAT(SUM(Budgets[Value]),"#####"),FORMAT(SUM(Budgets[Value]),"####.##"))


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...

This has work great thank you!

Only issue I have is that is is leaving some of the whole numbers with a decimal point and nothing after it, but not all, see image below. These are whole numbers so a little strange any thoughts? 

BuistJF_0-1695894426142.png

Works great for the decimal place. Logic is identical to above though have reduced to a single decimal point, though issue occured with 2.

I have got around this issue by adjusting the DAX: 

Metric Value = IF(MOD(SUM('DSET_FUNNEL (2)'[True Value]),1)=0,FORMAT(SUM('DSET_FUNNEL (2)'[True Value]),"#####"),SUM('DSET_FUNNEL (2)'[True Value]))

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

FebPBI_Carousel

Power BI Monthly Update - February 2025

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

March2025 Carousel

Fabric Community Update - March 2025

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

Top Kudoed Authors