Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
LachlanO
Regular Visitor

Calculate same period last year from timeframe slicer

Hi all,

 

I have one master graph which the data is populated based on the selected slicers.

 

I am trying to calculate actual enquiries recieved as well as for the same period last year (which this timeframe is specified via the Timeframe slicer). Ideally would like a measure which is dynamic so that the same period last year is calculated based on the filtered Timeframe selections.

Thanks.

 

LachlanO_1-1700442013676.png

 

1 ACCEPTED SOLUTION
LachlanO
Regular Visitor

Believe I have solved it:
=
VAR TimeframeSlicer = SELECTEDVALUE('Date Parameter (table)'[Parameter])
Return CALCULATE([Enquiries], SAMEPERIODLASTYEAR(table[EnquiryDate].[Date]))

View solution in original post

2 REPLIES 2
LachlanO
Regular Visitor

Believe I have solved it:
=
VAR TimeframeSlicer = SELECTEDVALUE('Date Parameter (table)'[Parameter])
Return CALCULATE([Enquiries], SAMEPERIODLASTYEAR(table[EnquiryDate].[Date]))
Anonymous
Not applicable

Hi @LachlanO ,

It's glad to hear that your problem has been resolved. And thanks for sharing your solution here. Could you please mark your post as Answered? It will help the others in the community find the solution easily if they face the same problem as yours.  Thank you.

Best Regards

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! It's time to submit your entry.

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.