Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi community,
I'm trying to figure out a lookupvalue of price column by the matching of Dates an Contract, but filtered by ID (11) and Month (12) funtion in order to give me an outcome that has two conditions.
My Table A is:
Date | Contract | ID | Month | Price |
01-12-2020 | 2021 | 11 | 12 | 5 |
01-12-2020 | 2020 | 2 | 2 | 20 |
03-12-2020 | 2020 | 11 | 12 | 4 |
05-12-2020 | 2021 | 11 | 4 | 6 |
Table B:
Date | Contract |
01-12-2020 | 2021 |
03-12-2020 | 2020 |
05-12-2020 | 2021 |
Outcome:
Date | Contract | Price |
01-12-2020 | 2021 | 5 |
03-12-2020 | 2020 | 4 |
Thanks in advance!
Cheers,
Solved! Go to Solution.
Hi @Anonymous
You can achieve your goal by filter measure or build a calculated table.
Measure:
Measure = IF(MAX('Table A'[Date]) in VALUES('Table B'[Date])&&MAX('Table A'[Month]) =12&&MAX('Table A'[ID])=11,1,0)
Build a table visual by Date column and Price column. Then add measure in filter field and set it show items when value =1.
Result is as below.
Or you can build a calculated table.
Outcome =
SUMMARIZE (
FILTER (
'Table A',
'Table A'[Date]
IN VALUES ( 'Table B'[Date] )
&& 'Table A'[Month] = 12
&& 'Table A'[ID] = 11
),
'Table A'[Date],
'Table A'[Price]
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous
You can achieve your goal by filter measure or build a calculated table.
Measure:
Measure = IF(MAX('Table A'[Date]) in VALUES('Table B'[Date])&&MAX('Table A'[Month]) =12&&MAX('Table A'[ID])=11,1,0)
Build a table visual by Date column and Price column. Then add measure in filter field and set it show items when value =1.
Result is as below.
Or you can build a calculated table.
Outcome =
SUMMARIZE (
FILTER (
'Table A',
'Table A'[Date]
IN VALUES ( 'Table B'[Date] )
&& 'Table A'[Month] = 12
&& 'Table A'[ID] = 11
),
'Table A'[Date],
'Table A'[Price]
)
Result is as below.
Best Regards,
Rico Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , One way is that you create a join beween two by create a new concatenated column
key = [Date] & [Contract]
Second way is to create a date table and contrat table and use date and contract from that table. Join these tables with both the tables
Refer: https://www.youtube.com/watch?v=Bkf35Roman8
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.
https://www.sqlbi.com/articles/the-importance-of-star-schemas-in-power-bi/
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
97 | |
96 | |
82 | |
74 | |
66 |
User | Count |
---|---|
121 | |
105 | |
102 | |
82 | |
72 |