Forum Discussion
Calculate column based on filtered values
Hello everybody,
I'd like to ask you for help with a calculated column.
I have created a following column:
Where Optimal Energy is calculated with:
Optimal Energy = VAR __Energy = [Energy Cost]
I've tried to use ALLSELECTED in the formula, but can't seem to make it work.
FIJT , Measure display depend on visual group bys
like
Optimal Energy = VAR __Energy = max(Table[Energy Cost])
VAR __MinPrevInvestment = MINX(FILTER(allselected('Table'),[Energy Cost]<__Energy),[Investment])RETURN
IF(max([Investment])<__MinPrevInvestment, sum([Energy Cost]), BLANK())or force a row context
RETURN
sumx(Values(Table[ID]), IF(max([Investment])<__MinPrevInvestment, sum([Energy Cost]), BLANK()) )A row context of id is pushed in last return
4 Replies
- amitchandak
Super User
FIJT , A calculated column can not get updated with a slicer value. Slicer values can only be used measures
- FIJTFrequent Visitor
amitchandak Is there a way to make the calculated column as a measure?
- amitchandak
Super User
FIJT , Measure display depend on visual group bys
like
Optimal Energy = VAR __Energy = max(Table[Energy Cost])
VAR __MinPrevInvestment = MINX(FILTER(allselected('Table'),[Energy Cost]<__Energy),[Investment])RETURN
IF(max([Investment])<__MinPrevInvestment, sum([Energy Cost]), BLANK())or force a row context
RETURN
sumx(Values(Table[ID]), IF(max([Investment])<__MinPrevInvestment, sum([Energy Cost]), BLANK()) )A row context of id is pushed in last return