filter data in dataflow

arkiboys 9,686 Reputation points

would you say this expression in the dataflow filters for
the previous month data in the current year?
even if the current month is Jan 2023, will this filter get the previous month data which will be Dec 2022?

equals(year(toDate(dateColumnName,'yyyyMMdd')),year(addMonths(toDate($p_CurrentDate, 'yyyy-MM-dd'),-1)))
equals(month(toDate(dateColumnName,'yyyyMMdd')), month(addMonths(toDate($p_CurrentDate, 'yyyy-MM-dd'),-1)))


Azure Data Factory
Azure Data Factory
An Azure service for ingesting, preparing, and transforming data at scale.
10,145 questions
0 comments No comments
{count} votes

Accepted answer
  1. KranthiPakala-MSFT 46,442 Reputation points Microsoft Employee

    Hello @arkiboys ,

    Thanks for the question and using MS Q&A platform.

    Yes your expression will confirm if the provided source column date is last month or not.

    I have provided with an example in this thread as the ask seems to be same - check if data is for previous month


    Hope this helps. Do let me know if you have further query.


    0 comments No comments

0 additional answers

Sort by: Most helpful