Forum Discussion
viitama
8 years agoFrequent Visitor
creating new columns conditionally
Hi, I'm struggling with references and conditions. Here is my table and I wan't te recreate Res column. ID subID Vol Res A aa 1000 ac A ab 250 ac A ac 5000 ac B aa 50...
- 8 years ago
hi viitama
Try the same pattern I gave you last time
Res = VAR MaxFig = CALCULATE ( MAX ( 'Table'[Vol] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) ) RETURN CALCULATE ( VALUES ( 'Table'[subID] ), FILTER ( ALLEXCEPT ( 'Table', 'Table'[ID] ), 'Table'[Vol] = MaxFig ) )
Zubair_Muhammad
8 years agoCommunity Champion
hi viitama
Try the same pattern I gave you last time
Res =
VAR MaxFig =
CALCULATE ( MAX ( 'Table'[Vol] ), ALLEXCEPT ( 'Table', 'Table'[ID] ) )
RETURN
CALCULATE (
VALUES ( 'Table'[subID] ),
FILTER ( ALLEXCEPT ( 'Table', 'Table'[ID] ), 'Table'[Vol] = MaxFig )
)
viitama
8 years agoFrequent Visitor
I had something like that, but it is giving me error "A table of multiple values was supplied where a single value was expected". Not sure why that fails. Actually change VALUES to SELECTEDVALUE and it works. Thanks.
- Zubair_Muhammad8 years agoCommunity Champion