Forum Discussion
Time Series Chart Showing Selected Data and Prior Period based on Slicer
Hi all,
I'm trying to get have a time series graph show the Current Period (slicer selection) and the Prior Period (which is one year prior, based on the slicer selection).
I have managed to get a measure that shows what I want in aggregate but it falls down when using it against a date in the graph because it ignores the time filters. I'm deliberately wanting to show one year prior based on the date range selected e.g. if 2025-01-01 to 2025-01-31 is selected, the Prior Year shown (but not selected in the slicers) should be 2024-01-01 to 31-01-31. The values below check out, I'm just not sure how to not have the aggregated value show as a straight line on the graph.
My measure for Send Email 1YP =
- Anonymous1 year ago
Hello cazza
Thank you for reaching out to the Microsoft Fabric Forum Community.I have successfully reproduced your scenario in Power BI and I was able to get the expected output as per your requirement where:
- The current period's data (based on slicer selection) is shown, and
- The prior year's data for the same relative period (one year back) is calculated and displayed side-by-side in the table.
This allows you to clearly compare performance between the selected time window and the equivalent period from the previous year.
For your reference, I’m attaching the .pbix file so you can explore the solution in detail.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.
6 Replies
- Ashish_Excel
Solution Supplier
Hi,
Does this pattern work?
Measure = sum(Data[Value])
Measure1 = calculate([Measure],sameperiodlastyear(calendar[date]))
- cazzaFrequent Visitor
Hi,
I also have a scenario which is pretty much identical to the above except for the preceding period. I have managed to get variables to give me the answer but still have the same issue trying to plot it on a graph.
- AnonymousNot applicable
Hello cazza
Thank you for reaching out to the Microsoft Fabric Forum Community.I have successfully reproduced your scenario in Power BI and I was able to get the expected output as per your requirement where:
- The current period's data (based on slicer selection) is shown, and
- The prior year's data for the same relative period (one year back) is calculated and displayed side-by-side in the table.
This allows you to clearly compare performance between the selected time window and the equivalent period from the previous year.
For your reference, I’m attaching the .pbix file so you can explore the solution in detail.
If this information is helpful, please “Accept as solution” and give a "kudos" to assist other community members in resolving similar issues more efficiently.
Thank you.- AnonymousNot applicable
Hi cazza
May I ask if you have resolved this issue? If so, please mark the helpful reply and accept it as the solution. This will be helpful for other community members who have similar problems to solve it faster.
Thank you.
- AnonymousNot applicable
Hi cazza
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so other members can easily find it.
Thank you.