Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Hi all,
I have two columns that I need to compare and the comparison operator is saved in a third column. I am not sure how to write the query to use the operator that is saved in the cells
I tried using COMBINEVALUES but it return the whole thing as a string, rather than doing the operation
Any suggestions?
Solved! Go to Solution.
Hi @nellyvk
Thanks for the reply from @amitchandak , please allow me to provide another insight:
I create a set of sample:
Then add a calculate column:
Column =
SWITCH (
TRUE (),
'Table'[Value1] > 'Table'[Value2]
&& FIND ( ">", 'Table'[Operator],, BLANK () ) <> BLANK (), "True",
'Table'[Value1] = 'Table'[Value2]
&& FIND ( "=", 'Table'[Operator],, BLANK () ) <> BLANK (), "True",
'Table'[Value1] < 'Table'[Value2]
&& FIND ( "<", 'Table'[Operator],, BLANK () ) <> BLANK (), "True",
"False"
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @nellyvk
Thanks for the reply from @amitchandak , please allow me to provide another insight:
I create a set of sample:
Then add a calculate column:
Column =
SWITCH (
TRUE (),
'Table'[Value1] > 'Table'[Value2]
&& FIND ( ">", 'Table'[Operator],, BLANK () ) <> BLANK (), "True",
'Table'[Value1] = 'Table'[Value2]
&& FIND ( "=", 'Table'[Operator],, BLANK () ) <> BLANK (), "True",
'Table'[Value1] < 'Table'[Value2]
&& FIND ( "<", 'Table'[Operator],, BLANK () ) <> BLANK (), "True",
"False"
)
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@nellyvk , Try Expression.Evaluate in power query
New column in power query, assuming you have three columns with col2 as CheckParameter
Expression.Evaluate([Col1] & " " & [CheckParameter] & " " & [Col3])
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 96 | |
| 70 | |
| 50 | |
| 42 | |
| 40 |