locked
Example of a Date Filter RRS feed

  • Question

  • Hallo. I'm reading the definitive guide to dax and it's complicated as a mofo. Anyways, can someone assist with this time formula to get the YTD results for current year. Why do you have to use "All" in the filter and I'm using this would only work for date frame specified, right? 

    Calculate(SUMX(Sales, Sales[Unit Price]*Sales[Quantity]), FIlter(ALL('Date'), AND(Date[Date]>etc. etc. etc. 

    Monday, September 12, 2016 9:16 PM

Answers

  • Hi AlexMartini,

    >> Why do you have to use "All" in the filter and I'm using this would only work for date frame specified, right?

    All function returns all the rows in a table, or all the values in a column, ignoring any filters that might have been applied. This function is useful for clearing filters and creating calculations on all the rows in a table.

    In the formula you post, all is used in filter. The filter function is used to work for date frame specified(AND(Date[Date]>etc. etc. etc) from all the rows in Date table . Your formula means you calculate the sum of sales where the time satisfy the filter condition: Filter(ALL('Date'), AND(Date[Date]>etc. etc. etc.

    If you have any questions, please feel free to ask.

    Regards,
    Angelia
    Tuesday, September 13, 2016 2:33 AM