Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
Hello,
I created a new Dax column which uses the Search funtion as below:
Search_Version =
SWITCH (
TRUE (),
SEARCH ( "1.8.15", 'D_TT_Historic_Data_Creation_Date'[DESCRIPTION], 1, 0 ) > 0, "1.8.15",
SEARCH ( "1.8.150", 'D_TT_Historic_Data_Creation_Date'[DESCRIPTION], 1, 0 ) > 0, "1.8.150",
SEARCH ( "1.8.16", 'D_TT_Historic_Data_Creation_Date'[DESCRIPTION], 1, 0 ) > 0, "1.8.16",
SEARCH ( "1.8.160", 'D_TT_Historic_Data_Creation_Date'[DESCRIPTION], 1, 0 ) > 0, "1.8.160",
BLANK()
)
However, the search function will not differentiate the text and will show "1.8.15" and "1.8.150" as "1.8.15".
I've been trying to use wildcards like * or ? in different positions but with no success.
So, I'd like to ask your help in how I could adjust this code in order to get exactly the text match.
In case you need any other detail, just let me know.
Thank you
Marcelo
Solved! Go to Solution.
Change the order of the comparisons so that the more selective tests come before the less selective tests
HI @datanau001 ,
if you change the order it works.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
HI @datanau001 ,
if you change the order it works.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for the solution.
It was exactly what I was looking for.
Change the order of the comparisons so that the more selective tests come before the less selective tests
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 60 | |
| 44 | |
| 40 | |
| 37 | |
| 21 |
| User | Count |
|---|---|
| 178 | |
| 127 | |
| 116 | |
| 77 | |
| 54 |