Forum Discussion
Data Definition Tooltip
- 1 year ago
Hi alfaraj_ar ,
No, using CONTAINSSTRING() inside ISINSCOPE() will not solve your issue. The ISINSCOPE() function requires a direct column reference as its argument, like 'table a'[column 1], to check if the current query context is being grouped by that column. It cannot process the TRUE/FALSE logical output from CONTAINSSTRING(). The fundamental problem is a matter of evaluation context. When you place a field on a visual's Y-axis, it is treated as an aggregated value—an implicit measure—and the "scope" is no longer on the column itself. ISINSCOPE() is designed to check for this column-level grouping context, which is why it fails when the field is aggregated.
A more robust solution that respects your live connection constraint is to shift your strategy. Instead of one complex measure trying to detect which columns are in use, you should create a separate, simple tooltip measure for each field you wish to define. This approach sidesteps the detection problem by letting the Power BI visual engine handle the context. When you hover over a data point, Power BI evaluates every field in the tooltip well for that specific context.
You can implement this by creating a new measure for each column from 'table a' that requires a definition in the tooltip. For column 1, the measure would specifically look up its own definition.
Tooltip - Column 2 Definition = VAR Definition = LOOKUPVALUE( 'table b'[definition], 'table b'[Field], "column 2", "Definition Not Found" ) RETURN "Column 2: " & DefinitionYou would then create a similar measure for column 2 and any other columns that need to be part of your dynamic glossary.
Tooltip - Column 2 Definition = VAR Definition = LOOKUPVALUE( 'table b'[definition], 'table b'[Field], "column 2", "Definition Not Found" ) RETURN "Column 2: " & DefinitionOnce you have created these individual measures, select your visual. In the Visualizations pane, locate the Tooltips field well and drag all of your new tooltip measures into it. Now, when column 1 is used on the Y-axis, hovering over a data point will cause the 'Tooltip - Column 1 Definition' measure to be evaluated and display the correct information. This method is effective because it leverages Power BI's native behavior instead of fighting against its context evaluation rules.
For your broader knowledge, other advanced methods like Calculation Groups or Field Parameters could also solve this, but they are unavailable with a live connection. These features require modifying the data model, such as adding new tables, which is not permitted in your scenario. Therefore, creating individual tooltip measures is the most practical and reliable solution given your constraints.
Best regards,
Hi alfaraj_ar ,
I agree with DataNinja777 using CONTAINSSTRING() inside ISINSCOPE() doesn't resolve the issue because ISINSCOPE() expects a direct column reference and operates strictly within the grouping context. Once a field is placed on the Y-axis and aggregated, that context is lost, which explains why the measure breaks down.
Considering you have live connection, you can't modify the data model which unfortunately leaves you with this option to create different measures.
Thank you