Forum Discussion
Syndicate_Admin
5 years agoAdministrator
formula DAX
Good morning, I would like you to provide me with a formula to obtain the value to return, that is to say without in the column percentage continent the value% returns me the value before the % of the contario that returns me white.
| percentage | amount to be returned |
| 30d | white |
| 15d | white |
| 5d | white |
| 15d | white |
| 15d2% | 2% |
| 10d2% | 2% |
Thank you.
- Anonymous5 years ago
Hi Syndicate_Admin ,
You can create a calculated column as below:
amount to be returned = VAR _len = LEN ( 'Table'[percentage] ) VAR _pplace = IFERROR ( SEARCH ( "%", 'Table'[percentage], 1, 0 ), 0 ) VAR _dplace = IFERROR ( SEARCH ( "d", 'Table'[percentage], 1, 0 ), 0 ) RETURN IF ( _pplace > 0, MID ( 'Table'[percentage], _dplace + 1, _pplace - _dplace ), "white" )Best Regards
1 Reply
- AnonymousNot applicable
Hi Syndicate_Admin ,
You can create a calculated column as below:
amount to be returned = VAR _len = LEN ( 'Table'[percentage] ) VAR _pplace = IFERROR ( SEARCH ( "%", 'Table'[percentage], 1, 0 ), 0 ) VAR _dplace = IFERROR ( SEARCH ( "d", 'Table'[percentage], 1, 0 ), 0 ) RETURN IF ( _pplace > 0, MID ( 'Table'[percentage], _dplace + 1, _pplace - _dplace ), "white" )Best Regards