Forum Discussion

benjamin_sasin's avatar
benjamin_sasin
Icon for Resolver I rankResolver I
6 years ago

Relative Calculate Filter Value

I'm trying to figure out how to segement a calculated cumulative measure by breaking it down by a value in a third field (in my case "academic_year").

 

This has to do with the use of FILTER() with the value relative to the row calculated, such as FILTER(table[field] = [field]) rather than FILTER(table[field] = "absolute value").

 

With the following formula, I am obviously cumulating the previous academic year with the following one:

 

Cumulative = CALCULATE(COUNT('Sheet1'[user_id]),FILTER(ALLSELECTED(Sheet1),Sheet1[date] <= Max(Sheet1[date])))

 

 

I thought I could do the following to solve the problem of cumulating only within the same academic year:

 

Cumulative per Academic Year = CALCULATE(COUNT('Sheet1'[user_id]),FILTER(ALLSELECTED(Sheet1),Sheet1[date] <= Max(Sheet1[date]) && Sheet1[academic_year] = [academic_year]))

 

But that didn't change anything.

 

I also tried with COUNTROW(Sheet1) instead but that didn't work either, so I must be using the filter wrong.

 

(Also where is the clear documentation about this? I can't find anything relevant online. So links would be appreciated.)

 

PS I don't see any button to upload files here: so here is a dropbox link: https://www.dropbox.com/s/xd4fk8p4k9tifde/test_cumulative.pbix?dl=0

5 Replies