Forum Discussion
Custom tooltips in Line Chart Visuals Legend Issue
- 5 months ago
hello lkaneff
perhaps the mismatch result comes from not accurate measure?
here is a simple example of my dummy data.
When i create a measure for getting the value of ID, it will get wrong result.
to achive the right result, i made a column index, then i refered a measure to that index.
the important is you can not create a measure to get a value that is not a number so you need to repointing a number into that string value.
i am not sure if i explained correctly but hope you get the idea.
Hope this will help.
Thank you. - 5 months ago
hello lkaneff
that is depend on how your data is.
i did with indexing the column based on value for all data/rows. after indexing, i calculate which index has the max value on each date. then i calculate what country based on the return index.
but surely you can do with if statement to do this. in my experience, you can not rely on DAX to return a string value directly so you need a unique value for what you want to get then return that value into the string value.
take a note as mentioned by danextian , by default line chart will calculate across all lines.
Hope you get the idea.
Thank you.
Would you mind showing me the measure you used to get that to work. I'm a bit of a beginner. That is exactly what I want. I assume you did an if statement and then a text output. Am I on the right track? I can try it myself and if I can't figure it out I'll post again. Thanks for your help!
hello lkaneff
that is depend on how your data is.
i did with indexing the column based on value for all data/rows. after indexing, i calculate which index has the max value on each date. then i calculate what country based on the return index.
but surely you can do with if statement to do this. in my experience, you can not rely on DAX to return a string value directly so you need a unique value for what you want to get then return that value into the string value.
take a note as mentioned by danextian , by default line chart will calculate across all lines.
Hope you get the idea.
Thank you.
- lkaneff5 months agoHelper I
Excellent.
- lkaneff5 months agoHelper I
Sorry to bother you again but would you mind showing me what you had in your field well?
- Irwan5 months agoSuper User
hello lkaneff
please share your sample data that represent original data.
my field might be not work in your case, so it is better to work out with your data.
Thank you.
- lkaneff5 months agoHelper I
https://www.dropbox.com/scl/fi/gdfceb6ohzgvqaqo9dwe7/AdventureWorks-Practice-Tables.pbix?rlkey=xaiz3p42w3qnjv989ocw83nth&st=ipxr6wo7&dl=0 Here is my sample data with this same tooltip issue.