Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hope someone can help me on this whether in Power Query or DAX.
My data is Title and ID columns.
1st scenario - I need to create a new column that extracts the data from TITLE field that does not ends with ":X"
The column no ":X" is the expected output
2nd scenario - I need to create a new column that extracts the data from TITLE field that does not ends with value corresponding to ID field. Delimiter is ":". Sample is 2nd row below ID field contains "1234" so I have to remove ":1234" from Title field.
Expected output columns are no ":X" and no ":[ID]"
Title | ID | no ":X" | no ":[ID]" | |||
Alabama:Montgomery:1234 | 1234 | Alabama:Montgomery:1234 | Alabama:Montgomery | |||
Alaska:Juneau:X | Alaska:Juneau | Alaska:Juneau:X | ||||
Arizona:Phoenix:X | Arizona:Phoenix | Arizona:Phoenix:X | ||||
Arkansas:LittleRock:Test:X | Arkansas:LittleRock:Test | Arkansas:LittleRock:Test:X | ||||
California:Sacramento:est:3854 | 3854 | California:Sacramento:est:3854 | California:Sacramento:est | |||
Colorado:Denver:2021 | Colorado:Denver:2021 | Colorado:Denver:2021 | ||||
Connecticut:X:Hartford:AAA | Connecticut:X:Hartford:AAA | Connecticut:X:Hartford:AAA | ||||
Delaware:Dover:Type:7877 | 7877 | Delaware:Dover:Type:7877 | Delaware:Dover:Type |
For scenario 1, this formula works but it also extracts wherever my delimiter can be found. I only need to extract data if it ENDS with the delimiter
Solved! Go to Solution.
Hi @summer18
Try below DAX expressions ,
1.
2.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Thank you,
pls code in power query
Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.
Hi @summer18
Try below DAX expressions ,
1.
2.
Don't forget to give thumbs up and accept this as a solution if it helped you!!!
Thank you,
Glad to know !
@summer18
Could you please give a thumbs up and accept this as a solution as well, since you confirmed that DAX is working too?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
65 | |
63 | |
52 | |
37 | |
36 |
User | Count |
---|---|
82 | |
66 | |
61 | |
46 | |
45 |