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.
Hello,
I have two unrelated tables. In Table A I have a date column and I could like to add a calculated colum which sums up Work Hours in Table B, depending on a condition.
For each row in Table A, I would like to compare the date in Table A and check if it is between two dates in Table B. I would like this to iterate through all the rows in Table B and only sum up the hours where this condition is true.
I tried this, but it doesn't seem to work:
Any suggestions or help would be much appreciated.
Thanks!
Solved! Go to Solution.
Hi @SEunson
you may try
Hours =
VAR CurrentDate = TableA[Date]
RETURN
SUMX (
'Table B',
IF (
TableB[Start Date] < CurrentDate
&& TableB[Finish Date] > CurrentDate,
TableB[Work Hours]
)
)
Hi @tamerj1
Thanks for the response. I think this works. I'll just do some testing and will "Accept as Solution" if all looks ok.
Hi @SEunson
you may try
Hours =
VAR CurrentDate = TableA[Date]
RETURN
SUMX (
'Table B',
IF (
TableB[Start Date] < CurrentDate
&& TableB[Finish Date] > CurrentDate,
TableB[Work Hours]
)
)
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 |
---|---|
42 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
43 | |
39 | |
33 | |
18 | |
17 |