Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
10 months ago
Solved

Problem calculating with decimal numbers

I have a table in which I have decimal numbers as seen below:

As you can see it is formatted as decimal number.

While creating a measure I`m trying to calculate & count rows where the values is greater than 0.9, as seen below:

However the output is BLANK. When I try to find values > 0 it shows correct result, when I`m looking for values equal to 1, again it is working, but when I`m trying to use decimal value it is acting strangly.

To say more, when I`m trying to use > 0.1 or >0.000001 it seems that it takes it as 1 and shows result of >1, instead of values I provided.

Any idea what could be the cause?

  • Anonymous's avatar
    Anonymous
    10 months ago

    ok, I found a solution. Had to change my regional settings on my laptop from English (USA) to English (Europe). For some reason this was messing up the whole calculation

4 Replies

  • Anonymous's avatar
    Anonymous
    Not applicable

    ok, I found a solution. Had to change my regional settings on my laptop from English (USA) to English (Europe). For some reason this was messing up the whole calculation

  • Hi Anonymous 

    Could you please try below Step :

    1.Change the column’s data type to the correct format >> Decimal Number

     

    2. Create Calculated column:

    Flag = IF('Sample Data'[Number] > 0.9, 1, 0)

     

    3. You can create measure as well. It gives you aggregate outcome:

    TEMP = 
    CALCULATE(
        COUNTROWS('Sample Data'),
        'Sample Data'[Number] > 0.9
    )

     

  • Anonymous , Try using

    DAX
    CALCULATE(
    COUNTROWS('Quality Self-Assessment and Audit Tracker'),
    FILTER(
    'Quality Self-Assessment and Audit Tracker',
    'Quality Self-Assessment and Audit Tracker'[Self assessment score] > 0.9
    )
    )

     

    If it still gives error try using round inside filter

  • Anonymous's avatar
    Anonymous
    Not applicable

    bhanu_gautam thx for quick reply

    Unforutnately still the same results. What is interesting, even below DAX gives me count on values less then 1, not decimal I provided: