Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!See when key Fabric features will launch and what’s already live, all in one place and always up to date. Explore the new Fabric roadmap
Hello, I have below table and want to transform Column A to Column B with below output.
Basically, I want to remove all succeeding commas. I can do this in transform data however Column A is calculated in DAX and it's not present yet in transform data so I need a DAX to remove the succeeding commas.
Solved! Go to Solution.
@Anonymous , Use the below DAX
Column B =
VAR SplitString = SUBSTITUTE([Column A], ",", "|")
VAR StringTable = ADDCOLUMNS(
GENERATESERIES(1, LEN(SplitString) - LEN(SUBSTITUTE(SplitString, "|", "")) + 1),
"Element", PATHITEM(SplitString, [Value], TEXT)
)
VAR FilteredTable = FILTER(StringTable, [Element] <> "")
RETURN CONCATENATEX(FilteredTable, [Element], ",")
Proud to be a Super User! |
|
Hii @Anonymous
Can you please provide the snapshot of the required output?
@Anonymous , Use the below DAX
Column B =
VAR SplitString = SUBSTITUTE([Column A], ",", "|")
VAR StringTable = ADDCOLUMNS(
GENERATESERIES(1, LEN(SplitString) - LEN(SUBSTITUTE(SplitString, "|", "")) + 1),
"Element", PATHITEM(SplitString, [Value], TEXT)
)
VAR FilteredTable = FILTER(StringTable, [Element] <> "")
RETURN CONCATENATEX(FilteredTable, [Element], ",")
Proud to be a Super User! |
|
User | Count |
---|---|
88 | |
74 | |
69 | |
59 | |
56 |
User | Count |
---|---|
40 | |
38 | |
34 | |
32 | |
28 |