Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
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
User | Count |
---|---|
98 | |
90 | |
77 | |
71 | |
64 |
User | Count |
---|---|
115 | |
102 | |
98 | |
71 | |
67 |