Forum Discussion

nic88's avatar
nic88
Frequent Visitor
3 years ago

Problem with measure not working correctly

Hi, I have a measure I'm trying to create that displays the total amount a user has earned over time, but it should only display this value for the dates they were considered active. Each user is associated with a partner and I want to display the total amount for the partner for any given month in the table. If the month is after when they were active then that user's total won't be included for the partner. While a user is active it will include all of their earnings up to that date, like a running total.

I am not getting an error message but it isn't working correctly.

 

The measure:

Life Coverage = CALCULATE(
    SUMX( lifematics , lifematics[amount] ),
    FILTER(
        lifematics,
        lifematics[Start of Week Date] <= MAX(DimDate[Date])
       && (MAX(DimDate[Date]) <= min(profilestate[Modified Date]) && max(DimDate[Date]) >= MIN(profilestate[EffectiveActiveDate]) )
       )
    )
 

 

Relationships:

 

This is the current result which I know is incorrect. There should be some values and more partners.

 

This is the table with all the partners before trying to add in the measure. 

 

I have spent over 12 hours trying to get this to work. Any idead would be very appreciated.