Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
8 years ago
Solved

Dynamic filter on MONTH

I am looking for a measure to compute Sales in a specyfic scenario. When you look closer at my data set (call it Table1) you may notice 2018 is not closed yet. The latest MONTH for 2018 is 4 whilst...
  • NipponSahore's avatar
    NipponSahore
    8 years ago

    Just correcting the previous answer please do the following

     

    Create a new column as 

    Date = date(Table1[YEAR],Table1[MONTH],"01")

    and another column as 

    SalesYTD = var maxmonth = month(max(Table1[Date])) return if(Table1[MONTH] <= maxmonth ,Table1[SALES],0)

    You can now use the column SalesYTD for your calculation

  • Ashish_Mathur's avatar
    8 years ago

    Hi Anonymous,

     

    You may refer to my solution here.

     

    Hope this helps.