Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Generate Series input value

Hi Expert

I have a strange situation

Generate a series 

Ventana = GENERATESERIES(0, 9999, 1)
 
I want the user put the input value and then get the value and do some calculations.
The problem is when the user put 1000, the value show 999, when the user put 2000, the value show 1998
But if the user put 100, the value is OK, if the user put 200, the value is OK
 
Any idea?
Thanks
  • You have fallen victim to the sampling monster.

     

    Nothing you can do about it - except for using (much) smaller ranges or larger interval steps.

14 Replies

  • Hello, I know this post is a little older but today a customer of mine had the same issue and I come up with a work around, which may help others as well. 

    The problem is not with value generating, but with Slicer using Selected value selection. 

    You can change it to different Options - Style, like Greater then or equal to

    Then adjust the measure which was generated to use MIN(), instead of SELECTEDVALUE()

    Slicer will now contain 2 boxes, where 1 is showing maximal value you can chose. 

    You can then play with formatting, or overlay 2nd box with white rectangle to hide it. 



    Please mark my post as a solution in case it helped. 

    BR

    Martin 

    • le_tool's avatar
      le_tool
      Helper I

      worked as a charm, kudos ðŸŒ‹

    • SannieBogie's avatar
      SannieBogie
      New Member

      I was struggeling with this for a few days already, thank you so much! This works perfect

  • How is the GENERATESERIES table related to the user input?  Did you create some "What if?"  parameter?

    • Anonymous's avatar
      Anonymous
      Not applicable

      Hi!

      First created manually the same "what if" parameter structure, and then try create a What if parameter, but using the what if parameter have the same problem

      the result is a "table" with this two fields:

      1)List of values result with the generate series

      2) field that get the value: 

      Value = SELECTEDVALUE('Table'[listavalue])
       
      Thanks!
      • lbendlin's avatar
        lbendlin
        Super User

        That sounds correct.  Would you be able to post a sample pbix file?

  • You have fallen victim to the sampling monster.

     

    Nothing you can do about it - except for using (much) smaller ranges or larger interval steps.

    • Anonymous's avatar
      Anonymous
      Not applicable

      If i down the sample from 10.000 to 2.000 have the same problem

       

      IF i put the 1000 samples, have problems when i put 5, give me 4 for the result

       

      Bug?

  • You still see the "I"  warning even with 1000 at step 1

    Change the step to 5

    It's not a bug, it's a feature.  Seriously  - there is no way the visual can cram 1000 data points onto your screen. Not enough pixels.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      Thanks for all the explanation

      But how would be to create a INPUT VALUE and give the user these options an posibility ?

      • v-kelly-msft's avatar
        v-kelly-msft
        Community Support

        Hi Anonymous ,

         

        I found a similar thread which may explain the strange senario:

        The reason why some of the numbers don't appear and revert back to another number when entered is due to PBI sampling the data, the range that you are using is to big.

        https://community.powerbi.com/t5/Desktop/GENERATESERIES-not-selecting-certain-number-in-the-range/m-p/600346

        When you set a large range using GENERATESERIES,and when you select the number which is ranking over 1000*increment ,it will be sampled.As you tested before,the workaround to solve it is to choose a bigger increment,for example,in your senario,you set a series from 1 to 10000 with an increment 1,and you select 1000,which is ranking 1000,that's why you get a result of 999,which is a sampled result.

        See:

         

         

        When you change the increment to any value bigger than 1(should be an integer,decimal situation would be more complex),which will ensure that the selected value is below the ranking of 1000,and you will get the expected result:

         

        Best Regards,
        Kelly

        Did I answer your question? Mark my post as a solution!

         

  • keep doing what you are doing - that's what the "what-if"  feature is for.

  • Use the "Between Slicer" and have the same value in both boxes.