Forum Discussion
Anonymous
2 years agoNot applicable
How create a condition with LOOKUPVALUE
Hi! I have two different datas, as in the tables below country date type value peru 01/01/2023 old 5000 peru 02/01/2022 old 4000 peru 03/01/2022 old 8000 peru 04/...
Dangar332
Resident Rockstar
2 years agohi, Anonymous
i am done with different method
your first table as a1 and ypur second table as a2 and and create relationship bw date column
create measure
value old =
CALCULATE(SUM(a1[value]),a1[type]="old",KEEPFILTERS(a1[country]=SELECTEDVALUE(a2[country])))
create another measure
value new =
CALCULATE(SUM(a1[value]),a1[type]="new",KEEPFILTERS(a1[country]=SELECTEDVALUE(a2[country])))
Did i answer your question? Mark my post as a solution which help other people to find fast and easily.
- Anonymous2 years agoNot applicable
Are the other way that you don't need to create a relationship?
For me, this way it doesn't work
- Dangar3322 years ago
Resident Rockstar
hi, Anonymous
try below solution without using of relationship bw tables
Measure (1).valueold =CALCULATE(SUM(a1[value]),a1[type]="old",KEEPFILTERS(a1[country2]=SELECTEDVALUE(a2[country1])&&a1[date]=SELECTEDVALUE(a2[date1])))Measure (2).valuenew =CALCULATE(SUM(a1[value]),a1[type]="new",KEEPFILTERS(a1[country2]=SELECTEDVALUE(a2[country1])&&a1[date]=SELECTEDVALUE(a2[date1])))which give you below outout
here i am not use relationship bw tablei am provide link of .pbix file. refer Here
Did i answer your question? Mark my post as a solution which help other people to find fast and easily.