Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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/01/2022 | old | 3000 |
peru | 01/01/2023 | new | 1000 |
peru | 02/01/2022 | new | 8000 |
peru | 03/01/2022 | new | 500 |
peru | 04/01/2022 | new | 9000 |
USA | 01/01/2023 | old | 4000 |
USA | 02/01/2022 | old | 6000 |
USA | 03/01/2022 | old | 7000 |
USA | 04/01/2022 | old | 2000 |
USA | 01/01/2023 | new | 5000 |
USA | 02/01/2022 | new | 8000 |
USA | 03/01/2022 | new | 9000 |
USA | 04/01/2022 | new | 4000 |
country | date | value A |
peru | 01/01/2023 | 4444 |
peru | 02/01/2022 | 8000 |
peru | 03/01/2022 | 9000 |
peru | 04/01/2022 | 8000 |
USA | 01/01/2023 | 5555 |
USA | 02/01/2022 | 12000 |
USA | 03/01/2022 | 6000 |
USA | 04/01/2022 | 889 |
I tried add the column Value New using the code below, but it does not work
Value new = IF('data'[type] = "new", LOOKUPVALUE (
'data'[value],
'data'[date], [date]),
'data'[country], [country], "0")
the end result would be this
country | date | value A | Value Old | Value new |
peru | 01/01/2023 | 4444 | 5000 | 1000 |
peru | 02/01/2022 | 8000 | 4000 | 8000 |
peru | 03/01/2022 | 9000 | 8000 | 500 |
peru | 04/01/2022 | 8000 | 3000 | 9000 |
USA | 01/01/2023 | 5555 | 4000 | 5000 |
USA | 02/01/2022 | 12000 | 6000 | 8000 |
USA | 03/01/2022 | 6000 | 7000 | 9000 |
USA | 04/01/2022 | 889 | 2000 | 4000 |
hi, @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
Did i answer your question? Mark my post as a solution which help other people to find fast and easily.
Are the other way that you don't need to create a relationship?
For me, this way it doesn't work
hi, @Anonymous
try below solution without using of relationship bw tables
Measure (1).
which give you below outout
i 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.
is the goal to have both a old value and new value? I am not sure I understand the question here but if you want the "new" value for each country/date then you can use this:
I tried this solution, but returns only the general sum of value for just type . I want the value sum by data, country and type. I would like to use LOOKUPVALUE (using arguments data and country) with filter by type
I tried this too, but it doesn't work
New = LOOKUPVALUE (
'a1'[value],
'a1'[date], a2[date],
'a1'[country], a2[country],
'a1'[type], "new")
Can you try putting the country and date in a table then add the measure I provided. It should show you the new value for each date and country combo.
Check out the July 2025 Power BI update to learn about new features.
User | Count |
---|---|
22 | |
7 | |
6 | |
6 | |
6 |
User | Count |
---|---|
27 | |
10 | |
10 | |
9 | |
6 |