Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello,
I have a problem when I unpivot multiple columns. When I unpivot, it puts all the columns in one column names called "Attribute" and it removes all the spaces of the columns. Is there a way that I can prevent this from happening or a function I could run to re-add the spaces back? I renamed the columns from "Attributes" to "Questions"
Here is the column I would like to get spaces back:
Thanks!
Solved! Go to Solution.
Hi @Anonymous,
Please download the demo from the attachment. I would suggest you solve it by two steps instead one step in order to avoid long formula.
Text.Combine(List.ReplaceMatchingItems(Text.ToList([Attribute]), {{"A"," A"},{"B"," B"},{"C"," C"},{"D"," D"},{"E"," E"},{"F"," F"},{"G"," G"},{"H"," H"},{"I"," I"},{"J"," J"},{"K"," K"},{"L"," L"},{"M"," M"},{"N"," N"},{"O"," O"},{"P"," P"},{"Q"," Q"},{"R"," R"},{"S"," S"},{"T"," T"},{"U"," U"},{"V"," V"},{"W"," W"},{"X"," X"},{"Y"," Y"},{"Z"," Z"},{"0"," 0"},{"1"," 1"},{"2"," 2"},{"3"," 3"},{"4"," 4"},{"5"," 5"},{"6"," 6"},{"7"," 7"},{"8"," 8"},{"9"," 9"}}))
Text.Trim(List.Accumulate(Text.Split([new], " "), "", (seed, current) => if List.Contains({"0","1","2","3","4","5","6","7","8","9"} , current) and List.Contains({"0","1","2","3","4","5","6","7","8","9"} , Text.End(seed, 1) ) then seed & current else if List.Contains({"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"} , current) and List.Contains({"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"} , Text.End(seed, 1)) then seed & current else seed & " " & current), " ")
BTW, is this thread the same topic?
Best Regards,
Dale
Hi @Anonymous,
Please download the demo from the attachment. I would suggest you solve it by two steps instead one step in order to avoid long formula.
Text.Combine(List.ReplaceMatchingItems(Text.ToList([Attribute]), {{"A"," A"},{"B"," B"},{"C"," C"},{"D"," D"},{"E"," E"},{"F"," F"},{"G"," G"},{"H"," H"},{"I"," I"},{"J"," J"},{"K"," K"},{"L"," L"},{"M"," M"},{"N"," N"},{"O"," O"},{"P"," P"},{"Q"," Q"},{"R"," R"},{"S"," S"},{"T"," T"},{"U"," U"},{"V"," V"},{"W"," W"},{"X"," X"},{"Y"," Y"},{"Z"," Z"},{"0"," 0"},{"1"," 1"},{"2"," 2"},{"3"," 3"},{"4"," 4"},{"5"," 5"},{"6"," 6"},{"7"," 7"},{"8"," 8"},{"9"," 9"}}))
Text.Trim(List.Accumulate(Text.Split([new], " "), "", (seed, current) => if List.Contains({"0","1","2","3","4","5","6","7","8","9"} , current) and List.Contains({"0","1","2","3","4","5","6","7","8","9"} , Text.End(seed, 1) ) then seed & current else if List.Contains({"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"} , current) and List.Contains({"A","B","C","D","E","F","G","H","I","J","K","L","M","N","O","P","Q","R","S","T","U","V","W","X","Y","Z"} , Text.End(seed, 1)) then seed & current else seed & " " & current), " ")
BTW, is this thread the same topic?
Best Regards,
Dale
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
114 | |
99 | |
83 | |
70 | |
60 |
User | Count |
---|---|
150 | |
115 | |
104 | |
89 | |
65 |