Forum Discussion
Calculated column or Measure
- Anonymous5 years ago
Hi Anonymous ,
You don't have a column to use as hierarchy so I doubt you could create a matrix table.
Here's the formula for table visual.
Measure = var rb = SUM('Table'[RB]) var rv = SUM('Table'[RV]) return SWITCH(TRUE(), rb<>0&&rv<>0,"RB and RV", rb<>0&&rv=0,"RB not RV", rb=0&&rv<>0,"RV not RB" )Best Regards,
Jay
Anonymous
This should give you what you are looking for unless I misunderstand.
Flag =
SWITCH (
TRUE(),
'Table'[RV] <> 0 && 'Table'[RB] <> 0, "RV and RB",
'Table'[RV] <> 0 && 'Table'[RB] = 0, "RV not RB",
'Table'[RV] = 0 && 'Table'[RB] <> 0, "RB not RV",
"Not RV or RB"
)
It would be a calculated column you add to the first table.
Hello,
Thanks for your help. But the switch condition is similar to my if statemnt and it is computing the flag column result at each row level, i want to compute at aggregated value level like Table -02 results
Thanks!
- Anonymous5 years agoNot applicable
I forgot to mention that, i need to use the matrix visual for the reporting to showing hte details in hierarchy and drill down. But the matrix is not allowing to keep a measure field on the rows, the flag should be my starting point and upon drill down within that flag buckets i will show the other columns.
Thats the reason i was trying to do using calculated column but no luckThanks much!
- Anonymous5 years agoNot applicable
Hello Anonymous ,
Still I am not sure how would you like to show it in matrix,
but if your need is to create column for flag with aggregated result then you can try below,
Create a New table,
Table = DISTINCT(Table01[NAME])create a relationship between this two table based on Name columnAdd new columns in this table,RV_agg = CALCULATE(SUM(Table01[RV]),GROUPBY(Table01,Table01[NAME]))RB_agg = CALCULATE(SUM(Table01[RB]),GROUPBY(Table01,Table01[NAME]))Flag = IF('Table'[RV_agg]<>0 && 'Table'[RB_agg]<>0,"RV and RB",IF('Table'[RV_agg]<>0 && 'Table'[RB_agg]=0,"RV not RB","RB not RV"))