The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hiya,
I would like to add a new column in PBI and only remove the last character if i is letter. Could you please help? Thanks
Original Column | New Column |
1234A | 1234 |
4321B | 4321 |
6789D | 6789 |
12345 | 12345 |
Solved! Go to Solution.
Try the following:
New Column =
var ColumnLen = LEN('Table'[Column])
var lastCharacter = RIGHT('Table'[Column])
return IF(ISERROR(INT(lastCharacter)), LEFT('Table'[Column], columnLen - 1), 'Table'[Column])
Thanks it works perfectly 🙂
Try the following:
New Column =
var ColumnLen = LEN('Table'[Column])
var lastCharacter = RIGHT('Table'[Column])
return IF(ISERROR(INT(lastCharacter)), LEFT('Table'[Column], columnLen - 1), 'Table'[Column])
User | Count |
---|---|
15 | |
8 | |
6 | |
6 | |
5 |
User | Count |
---|---|
25 | |
13 | |
12 | |
8 | |
8 |