Forum Discussion
Anonymous
4 years agoNot applicable
Tooltip - Different Timeline Query
Hi guys, I need help on the tooltip. I have a bar chart in a report page that displays the averages of the category based on its last 12 months. Now, I want to have a tooltip that compares curren...
v-angzheng-msft
Community Support
4 years agoHi, Anonymous
try to create measures like below:
CurrentYear =
var _maxyear=MAXX(ALLSELECTED(Table1),'Table1'[Year])
var _r=
IF(HASONEVALUE(Table1[Year]),
CALCULATE(
SUM(Table1[Sale]),'Table1'[Year]=SELECTEDVALUE(Table1[Year])),
CALCULATE(
SUM(Table1[Sale]),'Table1'[Year]=_maxyear))
return _rLastYear =
var _maxyear=MAXX(ALLSELECTED(Table1),'Table1'[Year])-1
var _r=
IF(HASONEVALUE(Table1[Year]),
CALCULATE(
SUM(Table1[Sale]),'Table1'[Year]=SELECTEDVALUE(Table1[Year])),
CALCULATE(
SUM(Table1[Sale]),'Table1'[Year]=_maxyear))
return _r
Then create a tooltip page.
Or instead of using the tooltip page, you can use the small multiples feature to display multiple years of data.
Drag and drop the year field into the small multiples bucket.
Select the year you want to display in the filter or slicer.
Result:
Please refer to the attachment below for details.
Hope this helps.
Best Regards,
Community Support Team _ Zeon Zheng
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.