Forum Discussion
Expression Error: We cannot apply operator < to types Number and Duration
- 4 years ago
Hi, Anonymous
You can try to solve this problem with calculated columns.
Column = IF ( [Vulnerability_Test_Date] - [Vulnerability_Published_Date] >= 35 && [Severity] = "Critical", "Yes", IF ( [Vulnerability_Test_Date] - [Vulnerability_Published_Date] >= 65 && [Severity] = "High", "Yes", IF ( [Vulnerability_Test_Date] - [Vulnerability_Published_Date] >= 95 && [Severity] = "Medium", "Yes", "No" ) ) )If you try to solve it in Power query custom column, you need to do type conversion.
if (Number.From([Vulnerability_Test_Date] - [Vulnerability_Published_Date]) >=35) and [Severity] = "Critical" then "Yes" else if (Number.From([Vulnerability_Test_Date] - [Vulnerability_Published_Date])>=65) and [Severity] = "High" then "Yes" else if (Number.From([Vulnerability_Test_Date] - [Vulnerability_Published_Date])>=95) and [Severity] = "Medium" then "Yes" else "No"This is the relevant document, hope to help you:
https://docs.microsoft.com/powerquery-m/type-conversion
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi, Anonymous
You can try to solve this problem with calculated columns.
Column =
IF (
[Vulnerability_Test_Date] - [Vulnerability_Published_Date] >= 35
&& [Severity] = "Critical",
"Yes",
IF (
[Vulnerability_Test_Date] - [Vulnerability_Published_Date] >= 65
&& [Severity] = "High",
"Yes",
IF (
[Vulnerability_Test_Date] - [Vulnerability_Published_Date] >= 95
&& [Severity] = "Medium",
"Yes",
"No"
)
)
)
If you try to solve it in Power query custom column, you need to do type conversion.
if (Number.From([Vulnerability_Test_Date] - [Vulnerability_Published_Date]) >=35) and [Severity] = "Critical" then "Yes" else
if (Number.From([Vulnerability_Test_Date] - [Vulnerability_Published_Date])>=65) and [Severity] = "High" then "Yes" else if
(Number.From([Vulnerability_Test_Date] - [Vulnerability_Published_Date])>=95) and [Severity] = "Medium" then "Yes" else "No"
This is the relevant document, hope to help you:
https://docs.microsoft.com/powerquery-m/type-conversion
Best Regards,
Community Support Team _Charlotte
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.