Forum Discussion

Glsmnbsrn's avatar
Glsmnbsrn
New Member
5 years ago

Power Bi Default Date Value

Hi I'm trying to figure out a date periods problem.
 I created the Date Periods table and I'm using the type column with my slicer. I want my tables to be Month To Day(MTD)  by default when i close and reopen my report .I should be able to choose another selection for example YTD but When I open my report It should be MTD. How can I do this ? 

Date Periods =
UNION(
ADDCOLUMNS(DATESINPERIOD('Date'[Date], TODAY(),NOW(),DAY),"type","Today", "Order", 1),
ADDCOLUMNS(PREVIOUSDAY(LASTDATE('Date'[Date])),"type","Last Day", "Order", 2),
ADDCOLUMNS(DATESINPERIOD('Date'[Date], TODAY(),-7,DAY),"type","Last Week", "Order", 3),
ADDCOLUMNS(PREVIOUSMONTH(DATESMTD('Date'[Date])),"type","Last month", "Order", 4),
ADDCOLUMNS(DATESMTD('Date'[Date]),"type","MTD", "Order"))

2 Replies

  • Glsmnbsrn , You can use a relative date slicer.

    else you can have columns like 

     

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


    MTD Type = Switch( True(),

    eomonth([Date],0)= eomonth(Today(),0) && [Date] <=today() ,"MTD" ,
    Format([Date],"MMM-YYYY")
    )

     

     

    Is Today = if('Date'[Date]=TODAY(),"Today",[Date]&"")

     

    And use MTD measure

     

    refer

    Default Date Today/ This Month / This Year: https://www.youtube.com/watch?v=hfn05preQYA&list=PLPaNVDMhUXGaaqV92SBD5X2hk3TMNlHhb&index=35

  • Anonymous's avatar
    Anonymous
    Not applicable

    Hi Glsmnbsrn ,

     

    Currently the slicer does not have a default value for this function. You can vote for this idea.

     

     

    Best Regards,

    Stephen Tao

     

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.