Forum Discussion

Georg's avatar
Georg
Frequent Visitor
9 years ago
Solved

Dynamic x axis - show only January - selected month

  Hi Experts, is there a way to show only January - selected month figures? E.g. I would like to see January - June figures only if June is the selected month (selecting all month January thr...
  • Dog's avatar
    9 years ago

    Hi, 

     

    you could look at creating new measure that specifically looks at the selected filter and takes that as the max date but overrides the filter on the calculate

    This is assuming that you have a Dates table for filtering. (if no dates table let me know what you have got) 

     

    ActualToSelectedMonth:=

    var MaxDate = MaxDates([DateKey])

    return

    CALCULATE (
    [Actual], ALL('Dates')
    DATESYTD ( Dates[Datekey], "01/31" ),
    Dates[DateKey] < MaxDate
    )

    -------

    (the DATESYTD will need your month end day and month in there to know when to start from....) have edited to January for now. 

     

    in theory this should replace the current context filter on Month (again assuming it's in the dates table) for [actual] but still using it as a Max filter. 

     

    I've not got the same data as you so I'm hoping the above makes sense and assists.