Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more.
Get startedGrow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric challenge.
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])
User | Count |
---|---|
83 | |
77 | |
71 | |
69 | |
54 |
User | Count |
---|---|
105 | |
100 | |
91 | |
79 | |
68 |