# Any way to get the calculation in DAX

Hey All,
Please is there any way i can replicate this calculation on DAX?
GAP = 100 - MOBILITY%
Mobility is a measure already created, but to get GAP, you have to subtract 100 from Mobility%.
I tried using this formula but my results were off. Pls i need help on this.
@BrianJ
Attached are 3 screenshots,

1. The picture of my wrong result.
2. The DAX Calculation.
3. Screenshot of what the result should look like.

Thanks

Hello @Egbejiogu,

Thank You for posting your query onto the Forum.

Well the percentages (%) figures in actual are always in decimals i.e. for example 0.129 and than using the â€ś%â€ť format we convert them into the actual % figures i.e. for example 129.13%.

So now, in order to deduct the 100 from your mobility measure just simply write the formula as provided below -

`GAP = 1 - [Mobility]`

Thanks and Warm Regards,
Harsh

1 Like

@Harsh hanks for your prompt reply, I tried that and got same result.
So confusing now.

Hello @Egbejiogu,

Could you please upload the PBIX file? So that members of the forum can assist you in a better and efficient manner.

Since without the file itâ€™ll only consume the members time through guess work process.

Thanks and Warm Regards,
Harsh

As always, @Harsh is absolutely spot on. Your incorrect results could be due to: problems with your [Mobility] measure; problems with the context in which youâ€™re applying it; and/or problems with your data model. Without seeing your PBIX file itâ€™s impossible to tell which one is the culprit.

In addition, I noticed something in your earlier post â€“ a misinterpretation of the CALCULATE function. I think CALCULATE gives so many people trouble not because itâ€™s that difficult, but because it is so poorly named. CALCULATE actually has little to do with calculations directly, but instead changes the context of the calculation occurring. Thus, whenever I see CALCULATE, I mentally have trained myself to substitute CHANGECONTEXT() (a function that doesnâ€™t actually exist, but should - in the same way that REMOVEFILTERS can be used synonymously with ALL (in some casesâ€¦), but is much clearer as to what it is doing).

In your case above of CALCULATE(100), no context is being changed so CALCULATE isnâ€™t doing anything, which is why Harsh removed it (also because CALCULATE on a constant doesnâ€™t do anything either). Sam has a whole series of outstanding videos on CALCULATE in the Mastering DAX course:

Understanding context and the way CALCULATE can be used to manipulate it is probably THE key concept necessary to write proper DAX.

• Brian
3 Likes

Thanks @BrianJ and @Harsh both suggestions was helpful, My mobility formula was wrong
1- Mobility worked.
Thanks

1 Like

Hello @Egbejiogu,

Youâ€™re Welcome.

Weâ€™re glad that the formula worked for you and you found it useful.

Thanks and Warm Regards,
Harsh

1 Like

Hi @Egbejiogu, did the response provided by @Harsh and @BrianJ help you solve your query? If not, how far did you get and what kind of help you need further? If yes, kindly mark as solution the answer that solved your query. Thanks!