Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
AlB
Super User
Super User

Eliminating "first/external" filter in tooltip page

Hi all,

See the attached sample pbix where we implement the following:

1. We want to implement translation of titles for differnet viuslas in a report. We have a table TitlesT that provides, for a title in English, its translation into different languages:

Language  
EnglishTitle   
TranslatedTitle  
en-US TitleMain TitleMain
fr-FR TitleMain TitleMain_FR
de-DE TitleMain TitleMain_DE
en-US TitleTTip TitleTTip
fr-FR TitleTTip TitleTTip_FR
de-DE TitleTTip TitleTTip_DE

 

We have a simple measure for translating the title of visuals:

 

TitleMeasure = 
SELECTEDVALUE(TitlesT[TranslatedTitle])

 

 

We set, through a filter visual, TitlesT[EnglishTitle] to the English title that we want for the visual and [TitleMeasure] will return the translated title. We use [TitleMeasure] as fx in the title of the visual.

The language is selected through a filter on all pages in the filters pane and the titles of the visuals will be translated accordingly.

 

2. The report has a Main page with a simple chart MainChart.  We apply a visual filter to the chart with value TitlesT[EnglishTitle] = "TitleMain" to set the correct title to it.

 

3. We create a page tooltip called TTip. It has a simple chart (TTipChart). TTip is the tooltip for MainChart. We apply a visual filter to the TTipchart with value TitlesT[EnglishTitle] = "TitleTTip" to set the correct title

 

The expected behavior is that MainChart shows TitleMain (or any of its translations) as title and TTipChart shows TitleTTip (or any of its translations) as title. If you look at the pages in the attached pbix separately, that is what happens:

AlB_1-1727131011347.pngAlB_2-1727131043406.png

 

The problem is that when we hover above MainChart, the tooltip is shown without title:

AlB_0-1727130398834.png

 

This is because TitlesT[EnglishTitle] has both "TitleMain" and "TitleTTip" as values in the filter context (respectively set in the visual filters of MainChart and TTipChart). Thus the SELECTEDVALUE() in TitleMeasure returns blank and no title is shown in TTipChart.

 

Within the tooltip page,  we want to eliminate TitleMain and keep only TitleTTip from the filter context so that the TTipChart shows the correct title. 
How can we do that?

In essence, we want to keep the "closest" filter, applied to TitlesT[EnglishTitle] in the TTip page, and discard the "external" one coming from the Main page.

 

Thanks everyone

 

@OwenAuger @TomMartens @MFelix  @AlexisOlson @edhans @jdbuchanan71 

 

       

11 REPLIES 11
AlexisOlson
Super User
Super User

Use a separate measure for each title and remove the visual level filtering on EnglishTitle.

TitleMain = 
CALCULATE (
    SELECTEDVALUE ( TitlesT[TranslatedTitle] ),
    TitlesT[EnglishTitle] = "TitleMain"
)

TitleTTip = 
CALCULATE (
    SELECTEDVALUE ( TitlesT[TranslatedTitle] ),
    TitlesT[EnglishTitle] = "TitleTTip"
)

 

AlexisOlson_0-1727192899318.png

 

Updated pbix attached.

Thanks @AlexisOlson 

We need to use 1 (or a couple) generic measure for all visuals. If we customize the measure to each visual like in your example, we'd have 100s of measures in the report 

I'm only suggesting two measures, not one per visual.

 

If you augment your example to several more visuals, I can show you how to use these two generically.

@AlexisOlson 

You are hardcoding the title for the visual in the code for the measures. How would you generalize the measures with that?

Attaching a new pbix with more visuals

Thanks

The idea is to hardcode the visual type (Main vs Tooltip) rather than the title. To make it work, you need to augment your TitlesT table to a couple additional columns to make the logic work.

 

AlexisOlson_0-1727362289226.png

 

I've included a couple of variations of the tooltip measure that should work generically so you can use whichever you prefer.


If you want to use EnligshTitle as your filter on the main visual,

TitleTTip = 
CALCULATE (
    CONCATENATEX ( TitlesT, TitlesT[TranslatedTitle], "," ),
    ALL ( TitlesT[EnglishTitle] ),
    VALUES ( TitlesT[ID] ),
    TitlesT[Type] = "TTip"
)

 

If you want to use ID as the filter on the main visual,

TitleTTip2 = 
CALCULATE (
    CONCATENATEX ( TitlesT, TitlesT[TranslatedTitle], "," ),
    TitlesT[Type] = "TTip"
)

 

Notes:

  • I used CONCATENATEX because it's easier to debug and is the same as SELECTEDVALUE for a single value.
  • Instead of a numeric ID column, you could have a descriptive field that associates the main and tooltip titles.
parry2k
Super User
Super User

@AlB I think you need to turn off keep all filters on the tooltip page:

 

parry2k_0-1727137160823.png

 

And here is the output :

 

parry2k_1-1727137194220.png

 

 



Subscribe to the @PowerBIHowTo YT channel for an upcoming video on List and Record functions in Power Query!!

Learn Power BI and Fabric - subscribe to our YT channel - Click here: @PowerBIHowTo

If my solution proved useful, I'd be delighted to receive Kudos. When you put effort into asking a question, it's equally thoughtful to acknowledge and give Kudos to the individual who helped you solve the problem. It's a small gesture that shows appreciation and encouragement! ❤


Did I answer your question? Mark my post as a solution. Proud to be a Super User! Appreciate your Kudos 🙂
Feel free to email me with any of your BI needs.

Thanks @parry2k 

That is a last resort option but the actual report has many charts with situations like this so adding the filters that are needed manually after turning  Keep all filters off wouldn't be practical.

Additionally, I'm particularly interested in whether that external filter can be somehow programmatically eliminated

I can't think of a way to remove the (outer?) filter context coming from the main page. 

 

Not sure if this is a viable solution for you but, I made a copy of the TitlesT tables and used that in the TTip page and the measure for the TTip title and it seems to work.

jdbuchanan71_1-1727186822308.png

Table

 

TitlesT2 = TitlesT

 

TTip title measure

 

TitleTTMeasure = SELECTEDVALUE(TitlesT2[TranslatedTitle])

 

I had to set the filter for language on all pages for both of the titles tables

jdbuchanan71_2-1727186903467.png

I have attached my sample file.

 

 

Thanks @jdbuchanan71 

That is an option. It could also be done by duplicating just one column in the table (TitlesT[EnglishTitle])

I am however especially interested in whether that external filter can be programmatically eliminated, although it looks like it can't.

 

 

AlexisOlson
Super User
Super User

Can you share a simple pbix that reproduces this setup?

@AlexisOlson 
I edited the original post above to update the explanation and add a sample pbix

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

Find out what's new and trending in the Fabric Community.

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

Check out the November 2024 Power BI update to learn about new features.