Forum Discussion
DAX Comparison Operations do not support comparing values of type true/false with values of type txt
- 6 years ago
Anonymous sorry for the late reply, if you want to check AND , it has to be two && instead of single, single & means concatenate values and that's surely a problem, change it to this &&
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
Anonymous very hard to follow your expression but somewhere you are comparing text with the number and you need to check the data type of your columns and fix it accordingly.
I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos whoever helped to solve your problem. It is a token of appreciation!
⚡Visit us at https://perytus.com, your one-stop shop for Power BI related projects/training/consultancy.⚡
- Anonymous6 years agoNot applicable
Hi parry2k thanks for the response.
Is there a way that I can compare a text column with a number? Here are the columns I am comparing:
Qty Manufactured UM = the unit of measure we manufactured product in, for example: "Gal"
What I want to calculate is if the Qty Manufactured UM = "Gal" then take the quantity manufactured (number field) and multiply this by 8.3333 and by the specific gravity of the product (also a number field).
There are also times where I would like to calculate if the Qty Manufacutured UM = "E" (which stands for Each) AND the product package UM = "Gal" then take the Qty Manufactured (number field) and multiply this by the product package weight (also number field) * 8.3333 * the product specific gravity.
Example of what I wrote that did not work:
Measure =
SUMX (
'BATCH-REC-HDR',
SWITCH (
TRUE (),
'BATCH-REC-HDR'[Qty-Manufactured-UM]="Gal", 'BATCH-REC-HDR'[Quantity-Manufactured]*8.3333*'BATCH-REC-HDR'[PRODUCT.Specific-Gravity],
'BATCH-REC-HDR'[Qty-Manufactured-UM]="E" & 'BATCH-REC-HDR'[PROD-PKG.Weight-UM]="Gal", 'BATCH-REC-HDR'[Quantity-Manufactured]*'BATCH-REC-HDR'[PROD-PKG.Weight]*8.3333*'BATCH-REC-HDR'[PRODUCT.Specific-Gravity]