Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Dinamic Tooltip Title

Hello  I have created the Dax script below which changes the title of a reporting tooltip dynamically, however, if I have a category as "blank", there is no title being displayed at the moment. Is...
  • Anonymous's avatar
    Anonymous
    6 years ago
    [ToolTip Tile] =
        SWITCH ( TRUE (),
        
            HASONEFILTER ( Dataset[Category] ),
            	SELECTEDVALUE (
            		Dataset[Cateogry],
            		"Select Category" 
            	),
            	
            HASONEFILTER ( Dataset[Location] ),
            	SELECTEDVALUE (
            		Dataset[Location],
            		"Select Location"
            	),
            	
            "No record available"
        )

     

    If you want to save time, then you want to carry out calculation inside SWITCH, not outside. SWITCH will often (not always) perform only the needed calculations whereas if you take out the formulas and put them in variables outside SWITCH, all of them will get calculated (unnecessarily most of the time).

     

    Best

    D