Forum Discussion
Fcoatis
5 years agoPost Patron
Convert calculated column into measure
Hello, I have the following calculated column in a table called 'Admin':
Diff = [Quantidade]-LOOKUPVALUE(
Admin[Quantidade],Admin[Código],[Código],Admin[Data],
CALCULATE(
Max(Admin[Data]),
FILTER(
Admin,Admin[Código]=EARLIER(Admin[Código])&&Admin[Data]<EARLIER(Admin[Data])
)
)
)I can´t figure it out as a measure. Please help
TIA
Fcoatis , you may want to try,
Delta = VAR __dt = MAX ( Admin[Data] ) VAR __tb = TOPN ( 1, CALCULATETABLE ( Admin, ALLEXCEPT ( Admin, Admin[Código] ), Admin[Data] < __dt ), Admin[Data] ) RETURN MAX ( Admin[Quantidade] ) - MAXX ( __tb, Admin[Quantidade] )
5 Replies
- amitchandakSuper User
Fcoatis ,Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
- negi007Community Champion
Fcoatis When you use column or calculated column in your measure, you have to use it with some aggreage function like sum, max, min, count etc.
in calculated column you can use directly column name without using aggreage function.
for specify solution of your problem, you may share your powerbi file.