Microsoft Fabric Community Conference 2025, March 31 - April 2, Las Vegas, Nevada. Use code FABINSIDER for a $400 discount.
Register nowThe Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.
Hello community! I need help:
I have a table that contains unique dates with different data.
Ex: Date - Hours - Resource, etc.
1/4/2021 - 20 - 2
2/4/2021 - 30 - 3
3/4/2021 ----
At the same time, I have another table that is related to this through the date, but the dates are repeated since for each day, per client, a count of processed units is made. Ex:
Date - Number of pieces, etc.
1/4/2021 - 1000
1/4/2021- 2500
1/4/2021 - 8000
etc.
What I would need to do is take the sum of those values per day to the table first table. In the example, if for the 1/4 the sum is 11500, put that value in the first table that contains unique dates. With what DAX formula could I achieve it? I attach images to make it clearer. Thanks!
Solved! Go to Solution.
Hi @Arial36
If your tables are related to each other on the Date column, you could use below code to add a new column to the first table. (First table: TableA, Second table: TableB)
Total value = CALCULATE(SUM(TableB[Value]))
If no relationship exists on Date column, add a new column with code
Total value = CALCULATE(SUM(TableB[Value]),TableB[Date]=EARLIER(TableA[Date]))
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
Hi @Arial36
If your tables are related to each other on the Date column, you could use below code to add a new column to the first table. (First table: TableA, Second table: TableB)
Total value = CALCULATE(SUM(TableB[Value]))
If no relationship exists on Date column, add a new column with code
Total value = CALCULATE(SUM(TableB[Value]),TableB[Date]=EARLIER(TableA[Date]))
Regards,
Community Support Team _ Jing
If this post helps, please Accept it as the solution to help other members find it.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Check out the February 2025 Power BI update to learn about new features.
User | Count |
---|---|
85 | |
79 | |
54 | |
39 | |
35 |
User | Count |
---|---|
102 | |
80 | |
49 | |
48 | |
48 |