Forum Discussion
Need help on Like statement DAX
- Anonymous6 years ago
HI NickProp28 ,
You can have a look at this
https://www.sqlbi.com/articles/from-sql-to-dax-string-comparison/
Regards,
Harsh Nathani
- Anonymous6 years ago
Hi NickProp28 ,
I Tried replicating this with some dummy data. Work well for me.
Count = CALCULATE ( SUM ( Financial[Job Profit] ), FILTER ( Financial, Financial[Origin] <> Financial[Dest] && LEFT ( Financial[Origin], 2 ) IN { "SG", "MY" } && LEFT ( Financial[Dest], 2 ) IN { "SG", "MY" } ) )Just to troubleshoot ,try to Trim your Origin and Destination Columns in Power Query to removing leading spaces if any.
Regards,
Harsh Nathani
Hi all,
amitchandak mahoneypat Anonymous ,
I try it and come out with this DAX.
But the calculation is wrong. Can you guys take a look on my DAX.
Count = CALCULATE(SUM(Financial[Job Profit]),FILTER(Financial,Financial[Origin]<>Financial[Dest] && LEFT(Financial[Origin],2) IN {"SG","MY"} && LEFT(Financial[Dest],2) IN {"SG","MY"}))
This is from https://www.sqlbi.com/articles/from-sql-to-dax-string-comparison/
Hope you guys have a great day.
Best thanks.
Hi NickProp28 ,
I Tried replicating this with some dummy data. Work well for me.
Count =
CALCULATE (
SUM ( Financial[Job Profit] ),
FILTER (
Financial,
Financial[Origin] <> Financial[Dest]
&& LEFT (
Financial[Origin],
2
)
IN {
"SG",
"MY"
}
&& LEFT (
Financial[Dest],
2
)
IN {
"SG",
"MY"
}
)
)
Just to troubleshoot ,try to Trim your Origin and Destination Columns in Power Query to removing leading spaces if any.
Regards,
Harsh Nathani