Forum Discussion

BBConsultancy's avatar
1 year ago
Solved

Dynamic column chart 10 weeks

Hi,   In my Power BI report I want to put a column chart that show the [Sales] of the selected week and 10 weeks prior. I want to select the week using a slicer. I tried multiple things:   1. Mea...
  • BBConsultancy's avatar
    1 year ago

    Thanks! It definitely pointed me in the right direction. The DATESINPERIOD function doesn't accept weeks unfortunately, but I replaced that part with:

    VAR _MinWeek = _ChosenWeek- 10
    VAR _MaxWeek = _ChosenWeek+ 1
    VAR _DateRange =
    FILTER(
        ALL('Previous Reporting Date'),
        'Previous Reporting Date'[WeekNr] >= _MinWeek &&
        'Previous Reporting Date'[WeekNr] <= _MaxWeek &&
        'Previous Reporting Date'[Year] = _ChosenWeek
    )