Forum Discussion
Anonymous
1 year agoNot applicable
Transform Excel Command to DAX or M Language
Hi, I created this command but need help to transform it to Dax or M Language. Thanks...tksnota... (CASE WHEN transtype IN('N','C','P','F') AND (((gbkmut.transsubtype NOT IN ('R','S') A...
_AAndrade
1 year agoResident Rockstar
Please try this one
CalculatedTable =
ADDCOLUMNS(
'OriginalTable', // Replace 'OriginalTable' with the name of your table
"Debit",
IF(
CONTAINSROW({ "N", "C", "P", "F" }, [transtype]) &&
(
(NOT CONTAINSROW({ "R", "S" }, [transsubtype]) && [bdr_hfl] >= 0) ||
(CONTAINSROW({ "R", "S" }, [transsubtype]) && [bdr_hfl] < 0)
),
[bdr_hfl],
BLANK()
),
"Credit",
IF(
CONTAINSROW({ "N", "C", "P", "F" }, [transtype]) &&
(
(NOT CONTAINSROW({ "R", "S" }, [transsubtype]) && [bdr_hfl] >= 0) ||
(CONTAINSROW({ "R", "S" }, [transsubtype]) && [bdr_hfl] < 0)
),
BLANK(),
-[bdr_hfl]
)
)
Anonymous
1 year agoNot applicable
Hi,
I have these errors.
Thanks...tksnota...
- _AAndrade1 year agoResident Rockstar
Hi Anonymous,
Could you share a pbix file with same data so I could take a look?- Anonymous1 year agoNot applicable
Hi,
How about we change the Dax wherein any GL Code that starts with "7" and "4" will be extracted to Calculated Column called Debit and anything that starts with "8" will be credit (as shown)?
- _AAndrade1 year agoResident Rockstar
Anonymous,
I'm attaching a pbix file with a quick example. See if this could help you.