Forum Discussion
Percent change in tool tip
I have a report with a year slicer so different years can be compared, 2019 to 2021 for example. I wanto see the percent change between the two. I created the below measure and it shows correctly when I place it on the report, but if I put the same measure on the tool tip, then it shows up as 0%. It appears to just be pulling in the most recent year to the tool tip instead of all the selected years.
Any ideas how to make this work?
PercChange=
VAR __PREV_YEAR =
CALCULATE (
Fact_Lead[Count Lead],
FILTER (
Dim_date,
Dim_date[year] = MIN ( Dim_date[year] )
))
RETURN
DIVIDE (
CALCULATE (
Fact_Lead[Count Lead],
FILTER (
Dim_date,
Dim_date[year] = MAX ( Dim_date[year] )
))- __PREV_YEAR,
__PREV_YEAR
)
I figured out a solution. Not the most elegant, but gets it done. I removed the year from the column series and then created two measures to look at leads from the first year and last year like below. This gets the tool tip to show the change between the two. The only down side is that now more then two year's can't be viewed at once.
First Year Leads = VAR minyear = Dim_Date[minyear] RETURN CALCULATE(Fact_Lead[Count Lead],Dim_Date[Year] = minyear)
10 Replies
- Ashish_Mathur
Super User
Hi,
Can you share the download link of your PBI file?
- jonathansharpRegular Visitor
Hi Ashish, I am new to posting thing here so please forgive my ignorance. How to I share the link while making sure I am not sharing any company data? Also this PBI is getting its data from a seperate model that you wouldn't have access to, so would you even be able to view anything on the report?
- Ashish_Mathur
Super User
Hi,
You will have to anonymise the data and then share it with me. I am not sure of how much i can help, but i would like to try.
- jonathansharpRegular Visitor
Ashish_Mathur Here is a link to the file. I won't let me attach it here for some reason. I am getting this when I try.
https://drive.google.com/file/d/1eLAXdSpmBgez7iMs2fyznzvP3ZQ8GtU9/view?usp=sharing
- Ashish_Mathur
Super User
Hi,
I tried but i cannot figure out a solution. Sorry
- AnonymousNot applicable
I tested the scenario you mentioned. In fact, if there is no problem with the data displayed on the card for the measure, then there is no problem with the tooltips. When you use the Tooltips , did you turn on the Keep all filters in Tooltips ?
I have attached my pbix file ,you can refer to it .
Best Regard
Community Support Team _ Ailsa Tao
- jonathansharpRegular Visitor
I added the Numerator and Denomenator to the tool tip, and it looks like its only being passed one of the years, whichever one I am hovering over. If I hover over the 2019 bar, then the number switch to match it.
I checked the tool tip page, and it as Keep All Filters turned On.
- jonathansharpRegular Visitor
I figured out a solution. Not the most elegant, but gets it done. I removed the year from the column series and then created two measures to look at leads from the first year and last year like below. This gets the tool tip to show the change between the two. The only down side is that now more then two year's can't be viewed at once.
First Year Leads = VAR minyear = Dim_Date[minyear] RETURN CALCULATE(Fact_Lead[Count Lead],Dim_Date[Year] = minyear)