Forum Discussion

CahabaData's avatar
CahabaData
Icon for Memorable Member rankMemorable Member
9 years ago
Solved

filter by actual date

Table A PERIOD Country Purchases 1/1/2016 France 150 1/1/2016 Italy 100 1/1/2016 Belgium 250 1/1/2017 France 55   below are a series of Measures - where I've just altered t...
  • dedelman_clng's avatar
    9 years ago

    1) since you're using CALCULATE, you don't need the explicit FILTER

     

    2) If you don't convert the literal string 1/1/2016 to a date by use of DATE() (e.g. DATE(2016,1,1)) then PowerBI interprets it as "1 divided by 1 divided by 2016", giving a number value that converts to Dec 30, 1899 (I believe - somewhere around there).  Try

     

    ActiveByDate = calculate(
    		countrows('Table A'),
    		'Table A'[Period] > date(2016, 1, 1)  //or = or <, etc
    )

     

    Hope this helps.

    David