Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago
Solved

Decimals not Calculating Correctly

Hi,

 

I'm trying calculate the total Allowance for each Div Name  in DAX but I'm getting the wrong figures back when I validate it against Excel's formula.

 

 

 

 

 

 

 

I have a DimBudgetAllowance table which lists the Div Name and 0.05 in the Bidget Allowance for each Div Name in a Table.

 

Then I have Dax the below measure Budget Allowance % is bringing back 0.5% instead of 5% in my table visual against each Div Name.

 

Budget Allowance % = CALCULATE(SUMX(DimBudgetAllowance,DimBudgetAllowance[Budget Allowance])/100+0)

 

 

This measure is then used in the next measure below

Annual Allowance for Increases = ([HC Total Salary 31 Mar] * [Budget Allowance %])

SomethIng isn't correct and I think it's the DAX measure above. I just want to multiply the 0.05 against the total salary for each Div Name to get the Allowance total but allowance for each Div Name is not always the same therefore I need it to calculate against the values in a table.

 

Any help with this appreciated!

 

  • Anonymous's avatar
    Anonymous
    3 years ago

    Hi Anonymous 

     

    Thanks for comming back to me. I managed to solve this yesterday and  it transpired that I needed to link the Budget Allowance table to another table which worked.

2 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous 

     

    Thanks for comming back to me. I managed to solve this yesterday and  it transpired that I needed to link the Budget Allowance table to another table which worked.

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    (2) We can create measures. 

    Measure = MAX('Table'[Total Salary])*MAX('Table'[Allowance])
    Measure 2 = SUMX(VALUES('Table'[Div Name]),[Measure])

    (3) Then the result is as follows.

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

    If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly.