Forum Discussion
Automate the M query
My data source is SAP BW and I have 12 years of data in it, so I have to apply the filter and extract the data.
The filter is the starting line of the code.
7 Replies
- Greg_DecklerCommunity Champion
Nimai123 - Not quite following this, can you explain with example data? Before and after.
- Nimai123Post Patron
Hey Greg_Deckler
Example
Current month query for August
Start Date "[0CALMONTH].[201908]"
End Date "[0CALMONTH].[202008]" ----- August - 2020
{Cube.ApplyParameter, "[0I_CALMO]", {"[0CALMONTH].[201908]", "[0CALMONTH].[202008]"}},
Required Query to be in September Automatically.
Start Date "[0CALMONTH].[201908]"
End Date "[0CALMONTH].[202009]" ----- September - 2020
{Cube.ApplyParameter, "[0I_CALMO]", {"[0CALMONTH].[201908]", "[0CALMONTH].[202009]"}},
- v-kelly-msftCommunity Support
Hi Nimai123 ,
Create a query as below:
#"Added Custom" = Table.AddColumn(#"Changed Type with Locale", "End date", each Date.AddMonths([Date],13))And you will see:
Best Regards,
KellyDid I answer your question? Mark my post as a solution!
- Nimai123Post Patron