Forum Discussion
Anonymous
5 years agoNot applicable
Add column according to values from different rows
I created this simplified table of my data: Country Value Year Result France 2300 2021 Both Spain 5432 2021 Only '21 Germany 0 2021 Only '22 Italy 0 2021 None Fr...
- 5 years ago
Hi, Anonymous
try to create a measure like this:
Measure = var _t=FILTER(ALL('Table'),'Table'[Country]=MAX('Table'[Country])) var _t2=FILTER(_t,[Value]>0) var _t3= SWITCH(COUNTROWS(_t2),2,"Both",1,"Only"&MAXX(_t2,[Year]),"None") return _t3result:
Best Regards
zc
Did I answer your question? Mark my post as a solution!
zzcc
5 years agoFrequent Visitor
Hi, Anonymous
try to create a measure like this:
Measure =
var _t=FILTER(ALL('Table'),'Table'[Country]=MAX('Table'[Country]))
var _t2=FILTER(_t,[Value]>0)
var _t3=
SWITCH(COUNTROWS(_t2),2,"Both",1,"Only"&MAXX(_t2,[Year]),"None")
return _t3result:
Best Regards
zc
Did I answer your question? Mark my post as a solution!