Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Monthly Default date formula

Hi All,

 

Seeking your assistance on below:

 

I used this formula 

MonthlyDefault = IF(MONTH(Table1[Date])=MONTH(TODAY())-1, "Last Month", FORMAT(Table1[Date], "mmmm yyyy"))
 
To include "Last Month" for filter purposes, so that everytime we open the dashboard the "Last Month" data will always be the filter. The problem now is its combining both January 2020 & January 2021 data and making it both last month.
 
Can you please help me on this. Thank you so much in advance.
  • Anonymous , Your table or date table have a column like this, and use that in the filter

     

    Month Type = Switch( True(),
    eomonth([Date],0) = eomonth(Today(),-1),"Last Month" , //Last Month
    eomonth([Date],0)= eomonth(Today(),0),"This Month" , //This Month
    [Month Year]
    )

     

    or

     

    Month Type = Switch( True(),
    eomonth([Date],0) = eomonth(Today(),-1),"Last Month" , //Last Month
    [Month Year]
    )

1 Reply

  • Anonymous , Your table or date table have a column like this, and use that in the filter

     

    Month Type = Switch( True(),
    eomonth([Date],0) = eomonth(Today(),-1),"Last Month" , //Last Month
    eomonth([Date],0)= eomonth(Today(),0),"This Month" , //This Month
    [Month Year]
    )

     

    or

     

    Month Type = Switch( True(),
    eomonth([Date],0) = eomonth(Today(),-1),"Last Month" , //Last Month
    [Month Year]
    )