Forum Discussion

qwerty1253's avatar
qwerty1253
Frequent Visitor
2 years ago
Solved

DATEADD CON PARAMETROS - NO FUNCIONA

Es posible hacer funcionar la funcion DATEADD con un parametro en vez un numero exacto? EStoy intentando esto pero no funciona:

 

Due_date_extended = dateadd('Ventas'[dueDate], Parametros[valores_selected], day)
 
Parametros[valores_selected] es un SELECTVALUE de valores correlativos de 1 a 20.
 
Ese mismo valor lo inserté en un filtro para poder seleccionar de a uno, y que sea el elegico para "trabajar" en la funcion DATEADD, pero no funciona, parece, pese a eser seleccionado, estar entregandole BLANK a la funcion.
 
El selectvalue parece correcto, ya que si lo arrojo en una tarjeta, muestra el valor elegido. 
 
Alguna sugerencia para volver un DATEADD dinamico con parametros?
 
  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi qwerty1253 ,

     

    It seems to be able to work correctly, but I am not clear on what you intend, you can check the results below:

     

     

    Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

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

7 Replies

  • lukiz84's avatar
    lukiz84
    Icon for Memorable Member rankMemorable Member

    Which data type is Parameters[valores_selected]?

     

    Have you tried SELECTEDVALUE(Parameters[valores_selected])?

    • qwerty1253's avatar
      qwerty1253
      Frequent Visitor

      Hi, the values ​​are integers. And the measure is: SELECTEDVALUE(Parameters[selected_values],0). Still, when I click on the filter, it doesn't seem to select it, it shows it fine on a card, but it doesn't take it to the function. The function returns the same date of origin, it does not add the N days.

  • qwerty1253's avatar
    qwerty1253
    Frequent Visitor

    Hi, the values ​​are integers. And the measure is: SELECTEDVALUE(Parameters[selected_values],0). Still, when I click on the filter, it doesn't seem to select it, it shows it fine on a card, but it doesn't take it to the function. The function returns the same date of origin, it does not add the N days.

  • lukiz84's avatar
    lukiz84
    Icon for Memorable Member rankMemorable Member

    maybe you could do the original post in english too?

     

    and maybe show a little of your data and model (relationships)?

    • qwerty1253's avatar
      qwerty1253
      Frequent Visitor

      Thanks Lukiz, its goes on  English:

       

      """

      Is it possible to make the DATEADD function work with a parameter instead of an exact number? I'm trying this but it doesn't work:

      Due_date_extended = dateadd('Ventas'[dueDate], Parametros[selected_values], day)

      Parametros[selected_values] is a SELECTVALUE of correlative numbers ​​between 1 and 20.

      I inserted that same value in a filter to be able to select one at a time, and make it the chosen one to "work" in the DATEADD function, but it does not work, it seems, despite being selected, to be delivering BLANK to the function.

      The selectvalue seems correct as if I drop it on a card it shows the chosen value.

      Any suggestions to return a dynamic DATEADD with parameters who can be selected in a filter?"""

       

      I dont have relation between tables PARAMETERS and VENTAS. But, Parameteres should works anyway or not? i mean, is a Select variable , can it  iterate whit a function of date?

       

       

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi qwerty1253 ,

     

    It seems to be able to work correctly, but I am not clear on what you intend, you can check the results below:

     

     

    Hope it helps!

     

    Best regards,
    Community Support Team_ Scott Chang

     

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