cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
GuyAinley
Frequent Visitor

Dynamic Running Total For Same Period Previous Year

Hi all

 

I've created a measure to calculate a running total for a period determined by Timeline slicer which is this;

 

Running Sales During Period =
IF (
MIN ( 'Dates'[Date] )
<= CALCULATE ( MAX ( 'Sales Order'[Shipment Date] ), ALL ( 'Sales Order' ) ),
CALCULATE (
SUM ( 'Sales Order Quantity'[Total Sales] ),
FILTER (
ALLSELECTED ( 'Dates' ),
'Dates'[Date] <= MAX ( 'Dates'[Date] )
)
)
)

I'd like to do the same but for the same period, the previous year.  

 

Any help would be greatly appreciated.

1 ACCEPTED SOLUTION
v-henryk-mstf
Community Support
Community Support

Hi @GuyAinley ,

 

Because you filter in the "Filter", you only need to clear the filter conditions to get the same period the previous year.

v-henryk-mstf_2-1613713969214.png

 

v-henryk-mstf_1-1613713925321.png

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

 

Best Regards,
Henry

 

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

3 REPLIES 3
v-henryk-mstf
Community Support
Community Support

Hi @GuyAinley ,

 

Because you filter in the "Filter", you only need to clear the filter conditions to get the same period the previous year.

v-henryk-mstf_2-1613713969214.png

 

v-henryk-mstf_1-1613713925321.png

 

If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.

 

Best Regards,
Henry

 

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

GuyAinley
Frequent Visitor

Thanks @parry2k 

 

This the current state of my visual, running total on an area chart with the period determined by the timeline slicer.

 

GuyAinley_0-1613386717598.png

What I'd like to do is overlay another measure that calculates the same but for the same period the previous year..

 

The PBIX file is here. 

parry2k
Super User III
Super User III

@GuyAinley Can you share sample data and expected output.  Read this post to get your answer quickly.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490






Did I answer your question? Mark my post as a solution.

Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.





Helpful resources

Announcements
PBI User Groups

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

April Update

Check it Out!

Click here to read more about the April 2021 Updates!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

secondImage

Experience what’s next for Power BI

See the latest Power BI innovations, updates, and demos from the Microsoft Business Applications Launch Event.