Forum Discussion

DavidKress's avatar
DavidKress
Frequent Visitor
8 years ago
Solved

Dynamically changing Date slicer

Hi I'm working off an SQL Analysis Server cube and have created a couple of DAX measures which calculate the difference in sales from the same day the prior year.  I have a table which shows end cust...
  • v-xjiin-msft's avatar
    v-xjiin-msft
    8 years ago

    DavidKress

     

    I think you can try to use Power Query to create a new table which is containing today and 7 days before today. Then use this table value as slicer.

     

    Please refer:

    1. Go to Edit Queries, create a new blank query with Power Query script:

    = {Date.AddDays(Date.From(DateTime.LocalNow()),-7),Date.From(DateTime.LocalNow())}

    2. Change List to Table. Then you can get the dynamica today and 7 days before today.

     

    Thanks,
    Xi Jin.