Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
3 years ago

RemoveFilter Function Not Working Within Calculate when Last.Date is used as a Filter

Hi All, 
 
I've simplified my Data/Measure and attached a screenshot.
 
The Formula within my Measure is as follows:
  
CountRows for LastDate = CALCULATE(COUNTROWS(Sheet1),LASTDATE(Sheet1[Date]),REMOVEFILTERS(Sheet1))
 
I want to count rows only for the last date within the date column. Additionally, Ignore any Filters that are applied within the visuals. 
 
The desired value here should be 4. 
 
This works for all scenarios in the screenshots attached. 
 
Except when "Pre 10" or "01 January 2023" is Selected within the slicers. 
 
The Measure should Ignore All filters within the table. 
 
I think this is due to the fact that neither "2 Jan 2023" nor "Pre 10" have any values for the last date in the data.
 
Which is wrong, either there's an error within PowerBI or  I'm not understanding how these functions worked, (Most likely the latter). 
 
Would someone be able to suggest an alternative to achieve this?
 
 
 
 

  

 

  

2 Replies