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,
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
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 |
---|---|
115 | |
100 | |
88 | |
68 | |
61 |
User | Count |
---|---|
152 | |
120 | |
102 | |
87 | |
68 |