filter data in dataflow

arkiboys 8,301 Reputation points
2022-11-14T10:09:40.727+00:00

hello,
would you say this expression in the dataflow filters for
1-
the previous month data in the current year?
2-
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)))

thanks

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

Accepted answer
  1. KranthiPakala-MSFT 38,597 Reputation points Microsoft Employee
    2022-11-15T03:09:39.483+00:00

    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

    260289-image.png

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

    Thanks

    0 comments No comments

0 additional answers

Sort by: Most helpful