locked
Using calculate to filter by year RRS feed

  • Question

  • Is this formula correct? I now want to filter by year. Can I just write  Year = 2014?

    2013:=CALCULATE(count('Work Orders1'[Work Order Date]),'Work Orders1'[Work Order Date] <= DATE(2015,3,1))

    Tuesday, October 11, 2016 6:00 PM

Answers

  • Hi AlexMartini,

    >> 2013:=CALCULATE(count('Work Orders1'[Work Order Date]),'Work Orders1'[Work Order Date] <= DATE(2015,3,1)) Is this formula correct?

    There isn’t syntax error in your formula. It count all date cells which satisfies 'Work Orders1'[Work Order Date] <= DATE(2015,3,1)).

    If you just want to filter data for calculate Year = 2014, you need to have a Year column in your table, then we can filter the entire table with condition “[Year]=2014”. Please use the following formula.

    2014year:= CALCULATE(COUNT(Cost[date]),FILTER(all(Cost), Cost[Year]=2014))

    If you still have any problem, please feel free to ask.


    Best Regards,
    Angelia
    • Marked as answer by AlexMartini Thursday, October 13, 2016 6:34 PM
    Wednesday, October 12, 2016 12:21 PM