March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Solved! Go to Solution.
[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
[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
You can remove that IF condition from HASONEFILTER because it already returns TRUE if the column has one filter else it returns FALSE. You can try this construct, let me know if it doesn't work for you.
ToolTip_Tile =
VAR SelectedMainCategory =
HASONEFILTER ( Dataset[ Cateogry] )
VAR SelectedLocation =
HASONEFILTER ( Dataset[Location] )
VAR MainCategory =
SELECTEDVALUE ( Dataset[ Cateogry], "Select Category" )
VAR Location =
SELECTEDVALUE ( Dataset[Location], "Select Location" )
RETURN
SWITCH (
TRUE (),
SelectedMainCategory, MainCategory,
SelectedLocation, Location,
"No record available"
)
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
21 | |
19 | |
17 | |
9 | |
5 |
User | Count |
---|---|
36 | |
29 | |
16 | |
15 | |
12 |