Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. 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
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 37 | |
| 35 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 74 | |
| 70 | |
| 39 | |
| 35 | |
| 23 |