Forum Discussion
Tooltip for same period last year
Hi all,
I have a bar chart that includes bars from this year, but also from same period last year. Now when i am using a (pie chart) tooltip i have created it shows the pie chart with data fro this year, whether I hover over the bar chart of the current period or the bar chart of same period last week. Is there a way to make the pie chart show the information of last year when i hover over the bar of last year?
I have read this message Solved: Tooltip to display Correct Month/Year for visual s... - Microsoft Fabric Community where they say it is not possible, however that message is from 2018. Does anyone have know if what i am asking is possible or does anybody have a workaround?
5 Replies
- suparnababu8
Super User
Hi BobWestfield
You can try to create the donut chart with same measure, what are you using currently in your barchart. To get soultuion requesting you please share your expected output in the form of snapshot with some sample data.
Thanks.!
- BobWestfieldFrequent Visitor
Hi suparnababu8 thank you for your reply!
yes, I should have been a little more specific with my question.
i have this bar chart. Dark blue is revenue last year, light blue is revenue the year before.
The revenue is calculated by: Revenue = SUM(Dim_Leads[revenue])
The revenue of the year before is calculated by: Revenue last year = CALCULATE([Revenue ], SAMEPERIODLASTYEAR('Calendar'[Date])
Then i have a tooltip page with a pie chart to see which department is responsible for the revenue. The values for this pie chart is currently the measure: revenue
However, when hovering over the bars of last year (light blue) i still see the pie chart of the current month.
I have also tried having this as the value in the pie chart:
DynamicPieData =IF(HASONEVALUE('Calendar'[Year]) && VALUES('Calendar'[Year]) = YEAR(TODAY()),[Revenue],[Revenue last year])But this also does not workAny tips? - Uzi2019
Community Champion
Hi BobWestfield
You can check this videos
https://youtube.com/watch?v=a5HlBrBygVE
or try this
If you are using a tooltip page then you can can avoid passing the time by switch off keep all filters and drag the required filters below it.
Also with time intelligence you should be able to show last year same month or last period same month
using a measure like
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),dateadd('Date'[Date],-1,Year))
Year behind Sales = CALCULATE(SUM(Sales[Sales Amount]),SAMEPERIODLASTYEAR('Date'[Date]))
Or check this post:
This might help you to solve your query.
I hope I answered your question!
- Uzi2019
Community Champion
Hi BobWestfield
It is possible to have last year data on tooltip for current year hovering on it.
The above post have the solution. Must try that
I hope I answered your question!
- BobWestfieldFrequent Visitor
What I like about the default tooltip is that whenever i hover over the blue bar it provides only the details of the blue bar:
And when i hover over the gray bar it shows the data of that same period but last year:
However when i add a custom tooltip it always combines the two time periods. I have kind of fixed it by adding them both (current year and last year) seperately to the same tooltip :
Ideally i would have the bottom chart when hovering over the gray bar and the top chart when hovering over the blue bar, but i guess that is not possible?