Forum Discussion

wskallmeyer's avatar
wskallmeyer
Advocate II
7 years ago
Solved

Stacked area chart using dynamic date range

All,   I am showing a running total of counts for the past 2 years.  The chart is getting too wide for my customer.  I need to keep the totals based on the entire time period.  But I would like to ...
  • v-cherch-msft's avatar
    7 years ago

    Hi wskallmeyer 

    You may create a measure like below and use it in visual level filter and set it =1.

    Last 12 Month =
    VAR EndThisMonth =
        DATE ( YEAR ( TODAY () ), MONTH ( TODAY () ), 31 )
    VAR Enddate_LastMonth =
        EDATE ( EndThisMonth, -1 )
    RETURN
        IF (
            MAX ( 'Date'[Date] ) <= Enddate_LastMonth
                && MAX ( 'Date'[Date] ) > EDATE ( EndThisMonth, -13 ),
            1
        )
    

    Regards,