Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more
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
The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!
| User | Count |
|---|---|
| 39 | |
| 37 | |
| 33 | |
| 32 | |
| 29 |
| User | Count |
|---|---|
| 133 | |
| 88 | |
| 85 | |
| 68 | |
| 64 |