Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register 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!
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
13 | |
10 | |
9 | |
8 | |
6 |
User | Count |
---|---|
12 | |
12 | |
11 | |
9 | |
9 |