Forum Discussion

sraj's avatar
sraj
Icon for Responsive Resident rankResponsive Resident
6 years ago
Solved

Default to Current Month & year

Hi there,

 

Is it possible to default the current month and year on the page if I have just the year and month as a slicer? Please advise

 

Thank you!!

5 Replies

  • sraj , You need have this column in you date table and use that on your page

     

    Month Type = Switch( True(),
    eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,
    eomonth([Date],0)= eomonth(Today(),0),"This Month" ,
    Format([Date],"MMM-YYYY")
    )

     

    Sort on month year sort

    Format([Date],"YYYYMM")

     

    • sraj's avatar
      sraj
      Icon for Responsive Resident rankResponsive Resident

      Hi amitchandak - I am getting this error message.

       

      The syntax for 'Sort' is incorrect. (DAX(Switch( True(),eomonth([Date],0) = eomonth(Today(),-1),"Last Month" ,eomonth([Date],0)= eomonth(Today(),0),"This Month" ,Format([Date],"MMM-YYYY")) Sort on month year sortFormat([Date],"YYYYMM"))).

    • sraj's avatar
      sraj
      Icon for Responsive Resident rankResponsive Resident

      I was able to get these two columns on the report, but how do I put that on the page...I am not clear on what to do after adding these two columns.  PLease help!!