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

Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers. Get Fabric certified for FREE! Learn more

Reply
Rayudu1
Frequent Visitor

How to format <10 we need 2 decimals after >10 no need decimal places in dax query

Hi Team,
I have sales amount column , 
my requerment is Sales amount <10 we need 2 decimals
  ex. 1.35,8.55,9.27 ...... like that 
After that sales amount >=10  we dont need decimals we want only Integer number.

I have tried this below queries but >10 its showing .00 decimals.

Std_dev RoundUP1 =
Var Roundvalue= SELECTEDVALUE(sales_amount)
RETURN
If(Roundvalue<10,(VALUE(FORMAT(round(Roundvalue,2),"0.00"))),CONVERT(INT(Roundvalue),INTEGER))
or
Std_dev RoundUP3 =
Var Roundvalue= SELECTEDVALUE(sales_amount)
RETURN
If(Roundvalue<10,(VALUE(FORMAT(round(Roundvalue,2),"0.00"))),(VALUE(FORMAT(ROUNDUP(Roundvalue,0),"0")))
)


Please help me.

Sales_amount

1.67

2.88
3.43
10.56
11.29
100.58
256.19
9.37
6.10
2 ACCEPTED SOLUTIONS

did you add an if statement?

 

if sales_amount <10 then "0" else "0.00" 

View solution in original post

Thank you so much 

View solution in original post

4 REPLIES 4
Tutu_in_YYC
Super User
Super User

You can use Dynamic Format strings and an "if" statement. Here is a tutorial

https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-dynamic-format-strings

Thank you,
I have tried Dynamic format . its not working . its showing like 90.00 . I need only 90.

did you add an if statement?

 

if sales_amount <10 then "0" else "0.00" 

Thank you so much 

Helpful resources

Announcements
March PBI video - carousel

Power BI Monthly Update - March 2025

Check out the March 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 Solution Authors