Forum Discussion
DAX FORMULA
I HAVE MATCH RESULT AS 3:01,NEED TO ADD NEW COLOMN WHICH WILL INDICATE WIN/LOST
Hello rabeeh
Here some Contents that might come in handy Check these outOPTION-1
--------
Using SPLIT Function (Available in Power Query)If you are working with Power Query (M language) instead of DAX, you can split the column directly using the SPLIT function:
In Power Query:Right-click on the column -> Split Column -> By Delimiter -> Choose : as the delimiter.
This will create two separate columns.And then apply condition to compair the max value and return the respective winner
OPTION-2
--------
Create a calculated column with DAX
#STATUS =
VAR _val = 'TABLEX'[SCORE]
VAR _base = FIND(":", _val, 1, LEN(_val))
VAR _left = VALUE(LEFT(_val, _base - 1))
VAR _right = VALUE(MID(_val, _base + 1, LEN(_val) - _base))RETURN
SWITCH(
TRUE(),
_left = _right, "DRAW",
_left > _right, "Left Winner " & _left,
_left < _right, "Right Winner " & _right,
BLANK()
)
Please Provide some demo data inorder to get your required results
Thanks & Regards...
3 Replies
- dharmendars007Memorable Member
Hello rabeeh ,
Can you please give more details about your query which will help us to assist further.
Thanks
Dharmendar S
- BIswajit_DasImpactful Individual
Hello rabeeh
Here some Contents that might come in handy Check these outOPTION-1
--------
Using SPLIT Function (Available in Power Query)If you are working with Power Query (M language) instead of DAX, you can split the column directly using the SPLIT function:
In Power Query:Right-click on the column -> Split Column -> By Delimiter -> Choose : as the delimiter.
This will create two separate columns.And then apply condition to compair the max value and return the respective winner
OPTION-2
--------
Create a calculated column with DAX
#STATUS =
VAR _val = 'TABLEX'[SCORE]
VAR _base = FIND(":", _val, 1, LEN(_val))
VAR _left = VALUE(LEFT(_val, _base - 1))
VAR _right = VALUE(MID(_val, _base + 1, LEN(_val) - _base))RETURN
SWITCH(
TRUE(),
_left = _right, "DRAW",
_left > _right, "Left Winner " & _left,
_left < _right, "Right Winner " & _right,
BLANK()
)
Please Provide some demo data inorder to get your required results
Thanks & Regards...- rabeehRegular Visitor
Thank you 👌its working!!