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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

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]))

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

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

Helpful resources

Announcements
July 2024 Power BI Update

Power BI Monthly Update - July 2024

Check out the July 2024 Power BI update to learn about new features.

July Newsletter

Fabric Community Update - July 2024

Find out what's new and trending in the Fabric Community.