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.
It's possible to have calculated tables inside a measure but if you want to return a table, then you need to use CALCULATETABLE rather than CALCULATE. However, since you are using _inadequate_security_ inside a SWITCH as if it is True/False, I suspect that you meant to have an argument in CALCULATE other than the filter table.
Did you intend to write something like this? (Note the line before FILTER.)
Inadequately secured loans =
VAR _inadequate_security =
CALCULATE (
ISEMPTY ( 'Table1' ),
FILTER (
'Table1',
'Table1'[Collateral Amount] < 1.5 * 'Table1'[Loan Amount]
&& NOT ( 'Table1'[Product ID] IN { 2222, 8888 } )
)
)
VAR _result_ =
SWITCH (
TRUE (),
_inadequate_security, "Inadeqaute Security",
"Adequate Security"
)
RETURN
_result_
I am getting the same problem
i have the same isuue with :
It's possible to have calculated tables inside a measure but if you want to return a table, then you need to use CALCULATETABLE rather than CALCULATE. However, since you are using _inadequate_security_ inside a SWITCH as if it is True/False, I suspect that you meant to have an argument in CALCULATE other than the filter table.
Did you intend to write something like this? (Note the line before FILTER.)
Inadequately secured loans =
VAR _inadequate_security =
CALCULATE (
ISEMPTY ( 'Table1' ),
FILTER (
'Table1',
'Table1'[Collateral Amount] < 1.5 * 'Table1'[Loan Amount]
&& NOT ( 'Table1'[Product ID] IN { 2222, 8888 } )
)
)
VAR _result_ =
SWITCH (
TRUE (),
_inadequate_security, "Inadeqaute Security",
"Adequate Security"
)
RETURN
_result_
Hi there.
First and foremost, is this a measure? A calculated column?
The error you get stems from the fact that you cannot use CALCULATE to calculate tables in it, only scalar values, but FILTER does return a table, so it can't be used with CALCULATE as the first argument. The CALCULATE that you have wrapped FILTER in is totally unnecessary and, indeed, incorrect in this place. Also, please bear in mind you cannot return a table from a measure. Only scalar values are possible.
Incidentally, you have posted this question on a forum that deals with Power Query, not with DAX.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
14 | |
13 | |
12 | |
12 | |
12 |