Don't miss your chance to take exam DP-600 or DP-700 on us!
Request nowLearn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now
Hi Experts,
I am novice to power bi and struggling with query in sql to convert in dax query.
For example :
IH06.TPLNR_FUNCTIONALLOC NOT LIKE '16__9___'
How to convert query in dax query?
Solved! Go to Solution.
Hi @vividarinda ,
You can create a calculated column as below to get it:
Category =
SWITCH(
TRUE(),
LEFT([UnitNo], 2) = "77", "KBL",
LEFT([UnitNo], 2) = "16" && MID([UnitNo], 5, 1) = "9", "Rental",
"PETROSEA"
)
Best Regards
Hi @vividarinda ,
I created a sample pbix file(see the attachment), please check if that is what you want.
Table 2 = FILTER('Table',IFERROR(SEARCH("16__9___",'Table'[TPLNR_FUNCTIONALLOC],1,0),0)=0)
Best Regards
Hi @Anonymous ,
Thanks your feedback, i mean, can i filter with escape underscore in dax query?
IH06.TPLNR_FUNCTIONALLOC NOT LIKE '16__9___'
@vividarinda
DAX has a function called CONTAINSSTRING, it should work for you.
Example:Countries ending with "land"
Evaluate
FILTER ( ALL ( Customer[CountryRegion] ), CONTAINSSTRING ( Customer[CountryRegion], "*land" ) )
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Hi @Fowmy ,
Thanks your feedback, i mean, can i filter with escape underscore in dax query?
IH06.TPLNR_FUNCTIONALLOC NOT LIKE '16__9___'
Hi @vividarinda ,
Could you please provide some raw data and samples to explain your requirement?
filter with escape underscore in dax query?
IH06.TPLNR_FUNCTIONALLOC NOT LIKE '16__9___'
Best Regards
I have a raw data like this,
| UnitNo | Category |
| 77DZ0279 | KBL |
| 77DZ0249 | KBL |
| 77GD9006 | KBL |
| 77GD0062 | KBL |
| 16DZ0277 | PETROSEA |
| 16EX0154 | PETROSEA |
| 16EX9011 | Rental |
| 16DZ9178 | Rental |
then i want filter based on condition like this :
- If UnitNo start with 77, then "KBL",
- If UnitNo start with 16__9___, then "Rental",
- If else "Petrosea"
Hi @vividarinda ,
You can create a calculated column as below to get it:
Category =
SWITCH(
TRUE(),
LEFT([UnitNo], 2) = "77", "KBL",
LEFT([UnitNo], 2) = "16" && MID([UnitNo], 5, 1) = "9", "Rental",
"PETROSEA"
)
Best Regards
Thank you very much for your help very helpful
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
Check out the February 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 55 | |
| 45 | |
| 38 | |
| 16 | |
| 15 |
| User | Count |
|---|---|
| 86 | |
| 68 | |
| 38 | |
| 29 | |
| 26 |