Forum Discussion

brankocareer's avatar
brankocareer
Helper I
1 year ago
Solved

Parameter issue

Hi all,

 

In Power BI, I created a Parameter:

Budget Parameter Salaries = GENERATESERIES(-1000, 1000, 1)

I then placed this variable in a slicer, which allows me to input numbers manually. However, an issue arises:

  • If I enter 1 and press Enter, it displays 1 correctly.

  • If I enter 2 and press Enter, it displays 1 instead.

The pattern is that odd numbers display correctly, while even numbers are shown as (even number - 1).
I am now change the Parameter to:  Budget Parameter Salaries = GENERATESERIES(-100,100, 1). Problem solved, what does this mean?
But I want to keep the range from -1000 to 1000, even bigger, I’m not sure how to resolve this issue, please help me out.

 


Thank you!

Branko

  • Hi brankocareer,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    The issue occurs because power bi numeric input slicer applies internal optimizations when handling large numeric ranges generated by GENERATESERIES. That is why there are unexpected rounding errors where even numbers display incorrectly.

    • Use the dropdown slicer instead of numeric input slicer, this will pick the exact values instead of applying internal optimizations.
    • Create a custom DAX table, this prevents the slicer optimizations that effect numeric input fields. Use the Value column in the slicer.
      Ex: Budget Parameter Salaries Table = ADDCOLUMNS(GENERATESERIES(-1000, 1000, 1), "Value", [Value])
    • Power BI slicers sometimes handle numbers as floating-point values internally, causing rounding errors. please use the following DAX command if required
      Budget Parameter Salaries = INT(GENERATESERIES(-1000, 1000, 1))

     

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

     

    Thanks and regards,

    Anjan Kumar Chippa

3 Replies

  • v-achippa's avatar
    v-achippa
    Community Support

    Hi brankocareer,

     

    Thank you for reaching out to Microsoft Fabric Community.

     

    The issue occurs because power bi numeric input slicer applies internal optimizations when handling large numeric ranges generated by GENERATESERIES. That is why there are unexpected rounding errors where even numbers display incorrectly.

    • Use the dropdown slicer instead of numeric input slicer, this will pick the exact values instead of applying internal optimizations.
    • Create a custom DAX table, this prevents the slicer optimizations that effect numeric input fields. Use the Value column in the slicer.
      Ex: Budget Parameter Salaries Table = ADDCOLUMNS(GENERATESERIES(-1000, 1000, 1), "Value", [Value])
    • Power BI slicers sometimes handle numbers as floating-point values internally, causing rounding errors. please use the following DAX command if required
      Budget Parameter Salaries = INT(GENERATESERIES(-1000, 1000, 1))

     

    If this post helps, then please consider Accepting as solution to help the other members find it more quickly, don't forget to give a "Kudos" – I’d truly appreciate it! 

     

    Thanks and regards,

    Anjan Kumar Chippa

    • fabiofoliveira's avatar
      fabiofoliveira
      Regular Visitor

      Pensando na possibilidade de trabalhar com um parametro, com valor unico.  Seria possível capturar o MINIMO e MAXIMO antes de executar a formula? O objetivo seria gerar a tabela com um intervalo controlado, gerada a partir do valor digitado pelo usuario:

       

      valor = GENERATESERIES ( MINIMO-5, MAXIMO+5 , 0.01)

       

      Ou até mesmo a utilização de um componente visual proprio para a digitação de numeros. Caso exista um componente, você poderia indicar?

  • Deku's avatar
    Deku
    Super User

    Is that the native regular slicer? I can't replicate