Forum Discussion

94veiga's avatar
94veiga
Helper II
5 years ago
Solved

What If Parameter

Hello! I´m having some problems trying to set a What If Parameter. I need a range from 0 to 100 with two decimals (45.45 for example)

 

When I introduce the number in the box, it returns me an inexact number. For example, If i write 23.45 Power BI returns me 23,12.

What can I do to solve this proble?

 

Thank you in advanced!!! 

  • Anonymous's avatar
    Anonymous
    5 years ago

    Hi 94veiga 

     

    The problem comes from the number of values the visual is retrieving.
    You can see the number from the DAX query visible with the Performance Analyzer tool:

    DEFINE VAR __DS0BodyPreLimit = 
      VALUES('0.01'[0.01])

    EVALUATE
      SAMPLE(1002, __DS0BodyPreLimit, '0.01'[0.01], 1)

    ORDER BY
      '0.01'[0.01]

     

    So if there is more than 1002 different values, some may not be taken.

    Using the following series show no problem: 0.01 = GENERATESERIES(CURRENCY(0.00), CURRENCY(10), CURRENCY(0.01))
    Anything with more than 1002 values will show the rounding problem.

    This visual does not have a hi-density mode that would take more samples.
    It's an idea to submit to the Ideas web site

     

    Best Regards,

    Rico Zhou

     

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

3 Replies

    • 94veiga's avatar
      94veiga
      Helper II

      It was created like this:

       

       

       

      This is what happens when I introduce a number.

       

      THE INPUT

       

       

      THE OUTPUT

       

       

      Thanks for your time!!

       

      • Anonymous's avatar
        Anonymous
        Not applicable

        Hi 94veiga 

         

        The problem comes from the number of values the visual is retrieving.
        You can see the number from the DAX query visible with the Performance Analyzer tool:

        DEFINE VAR __DS0BodyPreLimit = 
          VALUES('0.01'[0.01])

        EVALUATE
          SAMPLE(1002, __DS0BodyPreLimit, '0.01'[0.01], 1)

        ORDER BY
          '0.01'[0.01]

         

        So if there is more than 1002 different values, some may not be taken.

        Using the following series show no problem: 0.01 = GENERATESERIES(CURRENCY(0.00), CURRENCY(10), CURRENCY(0.01))
        Anything with more than 1002 values will show the rounding problem.

        This visual does not have a hi-density mode that would take more samples.
        It's an idea to submit to the Ideas web site

         

        Best Regards,

        Rico Zhou

         

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