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
Hi all,
I'd like to cut out the delimeter "-" if it's at the last position of the value. So every text value should not have - at the end.
How can this be done? Thanks.
Solved! Go to Solution.
Does your data contain the delimiter in any other position (for instance "ab-cdef")?
If not, you could simply use replace value, and replace "-" with "".
If yes, then:
Add column - > extract-> last 1 character.
Add column -> extract -> text before delimiter, scan from end of input:
Then add a conditional column:
Column1 would be your ID column here.
Then your data will look something like this:
note how the - is removed only from the end of string, not the middle.
You can keep the custom column and delete the other 3 now.
I hope this helps, let me know if you have any questions.
Proud to be a Super User! | |
Hi @Dn_wemn ,
Please create calculated column for your solution.
If this helps you please give kudos and accept my solution!
Thanks
Does your data contain the delimiter in any other position (for instance "ab-cdef")?
If not, you could simply use replace value, and replace "-" with "".
If yes, then:
Add column - > extract-> last 1 character.
Add column -> extract -> text before delimiter, scan from end of input:
Then add a conditional column:
Column1 would be your ID column here.
Then your data will look something like this:
note how the - is removed only from the end of string, not the middle.
You can keep the custom column and delete the other 3 now.
I hope this helps, let me know if you have any questions.
Proud to be a Super User! | |
It works here, but in my productive report which is Directquery, these steps are not allowed.
If you have a live connection to a database, then you should try to set these conditions in the datasource itself, before you connect to it in Power BI. Do you have access to the database you are connecting to?
Alternatively you could try to make Uzi's solution but as measure, instead of calculated column, but I am not sure it would work.
Proud to be a Super User! | |
HI, thanks for your answer. Its a direct query to Dataverse, so there is no database.
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 38 | |
| 38 | |
| 28 | |
| 27 |
| User | Count |
|---|---|
| 124 | |
| 88 | |
| 73 | |
| 66 | |
| 65 |