Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
1 year ago
Solved

Need Assistance on M Code

Hi,

 

Is it possible to create M or SQL Code wherein if any of the StartDate, EndDate or Reporting Month were changed then a refreshed was done the data would only covered what was specified. Eg. Reporting Date is 31/10/24 then only data on or before this date anything after will not be displayed?

 

It will also need to updat the date on F4 based on D4 less 30 days

 

I'm using the same table namely gbkmut

 

Thanks...tksnota...

 

 

4 Replies

  • Click here to download example PBIX solution fro Onedrive
    Click here 

     

    Test it by changing data in Input and then look at output

     

    Use 

    Date.AddDays([#" Date in"], -31)

     

    and then use a condition to only apply it to "Reporting mth"

     


    This works exactly as requested so please click [accept solution] and the thumbs up.

    We are unpaid volunteers so please be generous and click to reward kudos for our time and effort. 
    Thank you.

     

    If you asked the wrong question then please still click [accept solution] and the thumbs up.
    Then raise a new ticket, because it is unfair to not to reward kudos if you have asked vague or careless questions.


     

     

  • Anonymous's avatar
    Anonymous
    Not applicable

    Thanks...if the user wants the reporting month like in 2019 will this code still work? Can you share the file if it's ok?

    • speedramps's avatar
      speedramps
      Super User

      Please don't waste unpaid volunteer helpers time asking vague question.. Thank you.

       

      Please accept this solution and then take proper time and effort to ask a new question with example data.

       

      I am very keen to help but if you answer the wrong question and I give the correct answer then I expect you to accept the solution and not keep adding more vague narrative.

       

      Look forward to helping if and when you comply, but not before.