Forum Discussion

FrankMcQ's avatar
FrankMcQ
Frequent Visitor
6 years ago
Solved

Build a column based on a date filter from another table

Hi

 

I have a table of milestones:

Year      Start Date       End Date          Q1                     Q2                      Q3                       Q4

2018     01/10/2017     31/09/2018      01/10/2017       01/01/2018        01/04/2018         01/07/2018

2019     01/10/2018     31/09/2019      01/10/2018       01/01/2019        01/04/2019         01/07/2019

....

 

I also have a table of invoices:

Date                  Amount

01/11/2017       20.87

01/12/2017       32.31

...

 

I wanted to add columns to the financial milestones table to sum all of the invoices in that period... I'm using the following instruction:

Invoices in Q1 = CALCULATE(SUMX(FILTER('Invoices', 
AND('Invoices'[Invoice Date] >= 'Milestones'[Start Date], 'Invoices'[Invoice Date] < 'Milestones'[Q1])),  
'Invoices'[Amount]))


However I keep getting the error: 

Column 'Start Date', 'Q1' cannot be found or may not be used in this expression.

 

I'm struggling to understand why it can't find the columns - is it because I'm operating on the invoices table in the filter?

 

I guess I'm doing this incorrectly, any help would be gratefully received!

3 Replies