DAX calculation - Count of ids for all previous years than the selected year in the dropdown

36 views Asked by At

How to get count of all the previous years than the selected year in the dropdown with multiple filter conditions.

                  CALCULATE(
                    COUNT(current_ar[request_id]),  
                     FILTER(current_ar, 
                   current_ar[Fiscal_Year] < SELECTEDVALUE(current_ar[Fiscal_Year]))) 

syntax is not working as expected. I want all the previous years count while the selection is made on the year dropdown. How the syntax can be written above??

1

There are 1 answers

0
Sam Nseir On BEST ANSWER

You need to use ALL(...)

Your Measure = CALCULATE(
    COUNT(current_ar[request_id]),  
    FILTER(
      ALL(current_ar[Fiscal_Year]),
      current_ar[Fiscal_Year] < SELECTEDVALUE(current_ar[Fiscal_Year])
    )
  )