Forum Discussion

sharc316's avatar
sharc316
Helper I
9 years ago
Solved

Display Custom Timeframe by Week

Hi,   I would like to create a custom weekly timeframe that shifts every week. Here is the situation:   There are statements that come out every Wednesday for the previous week Sat-Fri. I would l...
  • v-huizhn-msft's avatar
    v-huizhn-msft
    9 years ago

    Hi sharc316,

    Sorry for misunderstanding your requirement in the original post.

    In order to show clearly, I create the sample table including date from 2017/4/1 to 2017/4/30.

    1. Create another date table only including date column, like Table2 in mine .pbix file.

    2. Create a slicer including Table2[Date], create a measure get the day's weeknum selected .in slicer.

    select Date = WEEKNUM( CALCULATE(MAX(Table2[Date]),ALLSELECTED('Table2')))

    3. Create another measue to get previous week date in Table.

    Measure = CALCULATE(MAX('Table'[Date]),FILTER('Table','Table'[Week]=Table2[select Date]-1))


    Create a table visual, select date and Measure as value level, when you select the 2017/4/19, it returns the previous week's date.



    Please download the file and test, please feel free to ask if you have other problem.

    Best Regards,
    Angelia