Forum Discussion
cheid_4838
Helper IV
2 years agoNeed help converting SQL Statement to DAX
I need to convert a SQL statement using "CASE" to a DAX statement. I want to have the results show "1" so I can calculate the total number of orders that have a glnumber beginning with 400 and an in...
- Anonymous2 years ago
Hi cheid_4838 ,
You can try calculated column like below:
Vol = IF ( LEFT('YourTable'[ivd_glnum], 3) = "400" && LEFT('YourTable'[ivh_invoicenumber], 1) <> "S", 1, 0 )Best Regards,
Adamk KongIf this post helps, then please consider Accept it as the solution to help the other members find it more quickly
AlexisOlson
Super User
2 years agoIt should be very similar.
Vol =
IF (
LEFT ( id[ivd_glnum], 3 ) = "400"
&& LEFT ( ih[ivh_shipper], 6 ) = "ALLBRI"
&& LEFT ( ih[ivh_invoicenumber], 1 ) <> "S",
1,
0
)
Check out this article for more SQL to DAX logic:
https://www.sqlbi.com/articles/from-sql-to-dax-string-comparison/