Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more
Hi Everyone
I want to split one column based on another column. In other words, I want to subtract the string of another column from the current column.
I'm looking for a DAX or PQ formula to reach to Result column by splitting the Name column based on Subcategory Column.
Please check the sample dataset below:
The current stat: 
| Subcategory | Name | 
| Courts | SCHOOL PARK COURT | 
| Playgrounds | MEMORIAL ELEMENTARY PLAYGROUNDS | 
The Result:
| Subcategory | Name | Result | 
| Courts | SCHOOL PARK COURT | SCHOOL PARK | 
| Playgrounds | MEMORIAL ELEMENTARY PLAYGROUNDS | MEMORIAL ELEMENTARY | 
Solved! Go to Solution.
Hi @Arman_And ,
You could try this:-
Column = 
VAR _found =
    FIND ( UPPER ( 'Table'[Subcategory] ), UPPER ( 'Table'[Name] ), 1, 0 )
RETURN
    TRIM (
        REPLACE ( UPPER ( 'Table'[Name] ), _found, LEN ( 'Table'[Subcategory] ), "" )
    )Output;-
Best Regards,
  Samarth
 
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
Hi @Arman_And ,
You could try this:-
Column = 
VAR _found =
    FIND ( UPPER ( 'Table'[Subcategory] ), UPPER ( 'Table'[Name] ), 1, 0 )
RETURN
    TRIM (
        REPLACE ( UPPER ( 'Table'[Name] ), _found, LEN ( 'Table'[Subcategory] ), "" )
    )Output;-
Best Regards,
  Samarth
 
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
Connect on Linkedin
 
					
				
				
			
		
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
Check out the October 2025 Power BI update to learn about new features.
 
            | User | Count | 
|---|---|
| 91 | |
| 49 | |
| 37 | |
| 31 | |
| 30 |