Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
2 years ago
Solved

Change month by Parameter

Hello,

I have a quastions it is possible to change a month in new column by parameter?

My DAX formula:

Kolumna = IF(AND(CONTAINSSTRINGEXACT('Koszty_bezpośrednie'[Budżet],"FORECAST"),CONTAINSSTRINGEXACT('Koszty_bezpośrednie'[Kategoria],"PRZYCHODY")),DATEADD('Koszty_bezpośrednie'[DataDokumentu],SELECTEDVALUE('Parametr 2'[Parametr]),MONTH),'Koszty_bezpośrednie'[DataDokumentu])
 

 

Everythink work when i change value of adding month by hand.

  • Anonymous's avatar
    Anonymous
    2 years ago

    Hi Anonymous ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    (2) We can create a measure. 

    Flag = IF(MONTH(MAX('Table'[date])) in VALUES(Parameter[Parameter]),1,0)

    (3) Place Flag=1 on the visual object filter of the waterfall diagram and then the result is as follows.

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

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

7 Replies

  • rks's avatar
    rks
    Icon for Resolver II rankResolver II

    Hi Koledzki, I would assume that it works. However, the DATEADD function expects a number as the 2nd parameter (DATEADD - DAX Guide) So the parameter should contain an integer.

     

    • Anonymous's avatar
      Anonymous
      Not applicable

      And so it is. 

      Parametr 2 = GENERATESERIES(0, 20, 1)
       
      Parameter accepts only integers, but when i change value on the fragmenter, nothing happens.
  • rks's avatar
    rks
    Icon for Resolver II rankResolver II

    I have tried it with my date table and it generally works...

    But I think I know your problem:
    Kolumna is probably a calculated column? Calculated columns do not have an relations to filters on the report itself. 

    You would need to create a measure and place it in your table.

    • Anonymous's avatar
      Anonymous
      Not applicable

      I need something diffrent, let's assume that for revenue category we have 5000 in Value column and it will be in 31.12.2024. Now, i need that using a parameter i can move this amount to 31.05.2023

      • rks's avatar
        rks
        Icon for Resolver II rankResolver II

        But you cannot achieve this by using a calculated column, because it is part of the model and not part of the report and its interactions.

        To help you any further we'd probably need more details in what you want to achieve in the report layer.

         

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Anonymous ,

     

    According to your description, here are my steps you can follow as a solution.

    (1) This is my test data. 

    (2) We can create a measure. 

    Flag = IF(MONTH(MAX('Table'[date])) in VALUES(Parameter[Parameter]),1,0)

    (3) Place Flag=1 on the visual object filter of the waterfall diagram and then the result is as follows.

     

    If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

     

    Best Regards,

    Neeko Tang

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