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.
I am trying to pass the tables based on another value. But it was showing an error when giving on it.
Any help, please?
Hi @msksenthil
OK, well, SWITCH can only return scalar values, not tables. Perhaps you can rewrite your code so that the measure returns a value that indicates which table to use?
Regards
Phil
Proud to be a Super User!
Hi @msksenthil
But the first parameter in your SWITCH isn't TRUE so how's it doing any comparison? How are you intending to compare tables? What is in these tables?
Can you share your file please.
Regards
Phil
Proud to be a Super User!
@PhilipTreacy Sorry, I can't share the file beacuse of the sensitivity.
Variable _a3 might be any one of values {1,3,4}
And, I have 3 calculated tables _a4, _a6 and _a7
I want to return
_a4 table if _a3=1,
_a6 table if _a3 = 3
else
_a7 table
Hope it clears my requirement
I trying to swap the TABLES (multiple values like column) instead of value (single value) bases on the TRUE() condition
Hi @msksenthil
What exactly are you trying to do? I don't understand how/why you are testing values and what to return.
It doesn't look like your SWITCH statements are correct.
The syntax is
SWITCH
(
VALUE_TO_TEST,
CONDITION_1, VALUE_TO_RETURN,
CONDITION_2, VALUE_TO_RETURN,
....
DEFAULT_VALUE_TO_RETURN
)
So you might typically use it like this
SWITCH
(
TRUE,
_var < 5 , "Less than 5",
_var < 10 , "Less than 10",
.....
"Greater than 100"
)
Regards
Phil
Proud to be a Super User!
User | Count |
---|---|
123 | |
76 | |
63 | |
50 | |
50 |
User | Count |
---|---|
175 | |
125 | |
60 | |
60 | |
58 |