Forum Discussion
New column
Anonymous Use a disconnected table with your group names including the All costs group. Then you can create a measure like this:
Measure =
VAR __Group = MAX('DisconnectedTable'[Column])
RETURN
SWITCH(__Group),
"Group1", CALCULATE('Table'[Income]),'Table'[AccountNo] = 3,
...
)Hi, sorry if my question was unclear.
What I want is to create a calculated column, not a measure. I have measures, and I want to visualize this calculated column using my already created measures.
I want my calculated column to look like below
NewColumn
Group1
Group2
Group3
All Groups --> (when I visualize the column with measures for this row, the measure value should show the sum of Group1 + Group2 + Group3)
I am using the expression below, but it's not giving me the expected results.
NewColumn= var g1 = account no=3 var g2 = account no in { 4, 5, 6} && account group <> 20 var g3= account group = 20 return SWITCH(TRUE(),g1,"Group1",g2,"Group2",g3,"Group3", g1 || g2 || g3, "All Groups" )
- Greg_Deckler4 years agoCommunity Champion
Anonymous Your calculation seems to be weird. It is like you are trying to return two values for the same row in the same column, both "Group1" and "All Groups". You can't do that, a row in a column can only have a single value, either "Group1" or "All Groups".
- Anonymous4 years agoNot applicable
Greg_Deckler Thanks for your reply!
Yes, that's the problem I am having. Is there any other way to do this?
- Greg_Deckler4 years agoCommunity Champion
Anonymous Not the way you are doing it, no. You could use 2 columns, one that has the Group1, Group2, etc. and the other that has like All Groups and Other Groups (or just blank). Or you could do it in the measure itself or the disconnected table trick as originally mentioned. But, no, you cannot magically insert two different values into the same row and column (cell) of a table. That would require quantum physics.
- Anonymous4 years agoNot applicable
Greg_Deckler I have other groups that are not mentioned in my post. as Group4, Group5, Group6, and AllGroup2 -> which is the sum of Group4, Group5 and Group6 So if I use total in the visualization it will give me the sum of all groups, not the sum under every third group.