Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hi,
I have 2 different tables(Table1 and Table2) having the same column names.
In Table 1, we have the Date column and corresponding Week column of the particular date.
Table 2 also same Date Column and here we have to find the week of the date.
My requirement is:
The logic behind the "Compare two date columns, when both dates are equal then the corresponding week(Table1) value is copied into the table 2 week column".
Table 1 | |
Date | Week |
Table 2 | |
Date | Week |
Thank you in advance.
Solved! Go to Solution.
Hi @sivasrao ,
Please try below steps:
1. below is my test table
Table1:
Table2:
2. create a measure with below dax formula
Week2 =
VAR cur_date =
SELECTEDVALUE ( Table2[Date] )
RETURN
CALCULATE (
MAX ( Table1[Week] ),
FILTER ( ALL ( Table1 ), Table1[Date] = cur_date )
)
3. add table visual with fields and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @sivasrao ,
Please try below steps:
1. below is my test table
Table1:
Table2:
2. create a measure with below dax formula
Week2 =
VAR cur_date =
SELECTEDVALUE ( Table2[Date] )
RETURN
CALCULATE (
MAX ( Table1[Week] ),
FILTER ( ALL ( Table1 ), Table1[Date] = cur_date )
)
3. add table visual with fields and measure
Please refer the attached .pbix file.
Best regards,
Community Support Team_Binbin Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you for your quick reply.
I have created a new column with this function and executed it successfully.
CALCULATE ( MAX ( Table1[Week] ), FILTER ( ALL ( Table1 ), Table1[Date] = cur_date )
Thank you.
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
135 | |
116 | |
101 | |
71 | |
61 |