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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
9kRPM
New Member

Calculating to specific decimal places without rounding

Hello Community Team,

 

I am having struggles with rounding the numbers. I don't want it to round after 2 decimals, but I am unsure of the dax grammar to make it so. Please find the snapshot. Unfortunately, explaining to the management team rounding issues, it still confuses them.

 

9kRPM_0-1697833215038.png

 

I would just like the Share Change= 0.9 - 1.0 = -0.1 (not the -0.2 shown from rounding).

 

My share formulas are:

Share Change = [Current Share] - [LY Share]

                                                                                                                                            

Current Share =
var Dollars = sum('Legacy YTD'[Current Dollars])
var ACV = CALCULATE(sum('Legacy YTD'[Current Dollars]), ALL('Legacy YTD'[Supplier]))

return
    DIVIDE(dollars*100,acv,0)
                                                                                                                                            
LY Share =
var Dollars = sum('Legacy YTD'[YA Dollars])
var ACV = CALCULATE(sum('Legacy YTD'[YA Dollars]), ALL('Legacy YTD'[Supplier]))

return
    DIVIDE(dollars*100,acv,0)
 
I have tried to search within here and it's not exactly working based on what I have seen for the solved solutions.
 
Thank you in advance.
1 ACCEPTED SOLUTION
OwenAuger
Super User
Super User

Hi @9kRPM 

If you would like the value of Share Change displayed in the visual to be equal to the difference between the displayed (i.e. rounded) values of Current Share and LY Share, I would suggest:

Share Change display =
ROUND ( [Current Share], 1 ) - ROUND ( [LY Share], 1 )

I would suggest just using this measure for display in visuals, but use the original Share Change in any calculations.

 

Does this work for you?

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

View solution in original post

2 REPLIES 2
9kRPM
New Member

That worked perfectly Owen! You're awesome! Thank you. I didn't know you could use the round function in a simple calc like that.

OwenAuger
Super User
Super User

Hi @9kRPM 

If you would like the value of Share Change displayed in the visual to be equal to the difference between the displayed (i.e. rounded) values of Current Share and LY Share, I would suggest:

Share Change display =
ROUND ( [Current Share], 1 ) - ROUND ( [LY Share], 1 )

I would suggest just using this measure for display in visuals, but use the original Share Change in any calculations.

 

Does this work for you?

Regards


Owen Auger
Did I answer your question? Mark my post as a solution!
Blog
Twitter
LinkedIn

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

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! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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