Forum Discussion
Distinct SUM from dimension table column
Hi dpc_development ,
The ID column establishes a one-to-many relationship between two tables, and directly finds the sum value of the corresponding ID field.
If the problem is still not resolved, please provide detailed error information and let me know immediately. Looking forward to your reply.
Best Regards,
Henry
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The problem is with the column to be summed being in the dimension table, not fact table.
As can be seen in the above relationship diagram, an event can take place over multiple days, and on each day, the fact table (Event Performance) has Revenue and Gross profit. The Spend in the Event table is how much was spent on that Event.
So eventually I have to total up all the Revenue and Gross Profit from the fact table and subtract Spend from the Event dimension table.
This is why I had a complex formula for Spend, but was wondering whether it could be simplified.