The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi,
I have this 2 tables (without connection), and a dimension date Table.
Table1
Name | Value | Date |
Prod1 | 2 | 20/02/2017 |
Prod2 | 3 | 20/05/2017 |
Prod3 | 4 | 20/08/2017 |
Prod1 | 5 | 24/02/2017 |
Table 2
Name | Value | Date Start | Date End | Type |
Prod1 | 2 | 20/01/2017 | 25/02/2017 | C |
Prod2 | 3 | 20/04/2017 | 25/05/2017 | C |
Prod3 | 4 | 20/07/2017 | 25/08/2017 | C |
Prod1 | 5 | 24/01/2017 | 25/02/2017 | C1 |
How can I achieve this:
If Value, Name, and DatesBetween Start and End match with table1, then Type..
Like this:
Name | Value | Date | Type |
Prod1 | 2 | 20/02/2017 | C |
Prod2 | 3 | 20/05/2017 | C |
Prod3 | 4 | 20/08/2017 | C |
Prod1 | 5 | 24/02/2017 | C1 |
Solved! Go to Solution.
@Anonymous
Hi, try with this measure:
Measure = CALCULATE ( FIRSTNONBLANK ( Table2[Type]; Table2[Type] ), FILTER ( ALL ( Table2 ), Table2[Name] = SELECTEDVALUE ( Table1[Name] ) && Table2[Value] = SELECTEDVALUE ( Table1[Value] ) && Table2[Date End] >= SELECTEDVALUE ( Table1[Date] ) && Table2[Date Start] <= SELECTEDVALUE ( Table1[Date] ) ) )
Regards
Victor
@Anonymous
Hi, try with this measure:
Measure = CALCULATE ( FIRSTNONBLANK ( Table2[Type]; Table2[Type] ), FILTER ( ALL ( Table2 ), Table2[Name] = SELECTEDVALUE ( Table1[Name] ) && Table2[Value] = SELECTEDVALUE ( Table1[Value] ) && Table2[Date End] >= SELECTEDVALUE ( Table1[Date] ) && Table2[Date Start] <= SELECTEDVALUE ( Table1[Date] ) ) )
Regards
Victor
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
100 | |
94 | |
80 | |
63 | |
56 |
User | Count |
---|---|
248 | |
122 | |
110 | |
77 | |
70 |