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.
Hello,
I want to create a calculated column.
I'm looking to create a DAX formula that removes the last character.
Example :
order_reference_order | New Order N° |
WQ032060Q | WQ032060 |
I try the formula below but all "Q" are deleted.
Solved! Go to Solution.
IF(
RIGHT([order_reference_order], 1) = "Q",
LEFT([order_reference_order], LEN([order_reference_order]) - 1),
[order_reference_order]
)
Try this 🙂 remember to mark as solution if correct. Cheers
Hello, the solution would be:
1) You calculate what the length of the field is by subtracting 1 (without the last character):
Length = len(order_reference_order)-1
2) Create the New Order Number field, collecting the number of characters indicated by the length:
New Order No. = left(order_reference_order,length)
Anything you tell me. Best regards,
IF(
RIGHT([order_reference_order], 1) = "Q",
LEFT([order_reference_order], LEN([order_reference_order]) - 1),
[order_reference_order]
)
Try this 🙂 remember to mark as solution if correct. Cheers
Hello @Anonymous ,
thanks for your help.
I tried your solution but there is an error message :
"Impossible to convert the value from text type to number type"
Have a nice day
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 |
---|---|
80 | |
76 | |
60 | |
36 | |
33 |
User | Count |
---|---|
91 | |
60 | |
59 | |
49 | |
45 |