cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
wskallmeyer
Advocate II
Advocate II

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 only show the last 12 months.  The X-axis has a Start and End Date but I don't see a way to make it dynamic based on my live data.  I could hard code the dates but then I would have to change it manually each month as I am in the screen shot below.

 

Snap9.jpg

 

Any ideas?  Or different charts I should use?

 

I am using the latest PBIRS (on premises).

 

Thanks in advance, Scott

1 ACCEPTED SOLUTION
v-cherch-msft
Microsoft
Microsoft

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,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

1 REPLY 1
v-cherch-msft
Microsoft
Microsoft

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,

Community Support Team _ Cherie Chen
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Helpful resources

Announcements
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.