March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
129 | |
90 | |
75 | |
58 | |
53 |
User | Count |
---|---|
200 | |
104 | |
101 | |
67 | |
55 |