Forum Discussion
IF statement totaling issues
There are four tables:
1- customer master
2- invoice header
3- invoice detail (including the dates of service)
4- master date table
Each invoice has 1 row in the header, and multiple in the detail. In order to figure out when the service was provided, running a SUMX on the detail table with a calculation on the number of days between MIN_Date & MAX_Date is necessary. The service dates in detail are tied to the master date table. So the only thing that can be pulled from the table are the start/end dates and line item amount.
A row can be either the customer account to see details OR a specific month in order to compare monthly trends.
Relationships are setup from: customer master >> invoice header >> invoice detail
Ok can you try something like
SUMX(SUMMARIZE(ALL_Dates, ALL_Dates[Month], ALL_Dates[Year], "Value", IF(...)), [Value])?