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!Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now
Does anyone know a good way to analyze model code options from strings?
I have a list model codes and I'm trying to find out what options are being ordered & analyze the data. I decided to find the code and create a column that says it exists (1) or doesn't exist (0) on
that line.
An example of how I'm approaching this in DAX is below:
Option H5 =
SWITCH( 'Table'[Model String], "5000X",
IF(FIND("H5", 'Table'[Model String], 5, 0) = 0 , 0, 1) )
So this starts searching at character 5 and returns either a 1 or a 0 if the code is found.
Example Table
Does anyone know a better way to do this?
In the random case below we'll say that the type of product is a 5000X and everything after that is an "option" in the model string. These could be in any combination but I would assume they are unique codes. These options could be used across different types of products (e.g. 6000X, 7000X, etc...).
There are some cases where the product type has a different number of characters (e.g. 5000X, 5000XX) so if you know an even better way to include that in analyzing this data I would love to hear it.
I have other columns that have the product types listed (5000x, 6000X, 5000XX, etc...).
Solved! Go to Solution.
Hi @Andrew1 ,
Please try to create column with below dax formula:
H5 = IF(CONTAINSSTRING([Model String],"H5"),1,0)M6 = IF(CONTAINSSTRING([Model String],"M6"),1,0)R7 = IF(CONTAINSSTRING([Model String],"R7"),1,0)Z2 = IF(CONTAINSSTRING([Model String],"Z2"),1,0)
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Andrew1 ,
Please try to create column with below dax formula:
H5 = IF(CONTAINSSTRING([Model String],"H5"),1,0)M6 = IF(CONTAINSSTRING([Model String],"M6"),1,0)R7 = IF(CONTAINSSTRING([Model String],"R7"),1,0)Z2 = IF(CONTAINSSTRING([Model String],"Z2"),1,0)
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 12 | |
| 9 | |
| 8 | |
| 5 | |
| 3 |
| User | Count |
|---|---|
| 27 | |
| 22 | |
| 20 | |
| 18 | |
| 12 |