Forum Discussion

Shackwell's avatar
Shackwell
Helper III
4 years ago

Filters by month

Hello.

 

I have a database involving some costs from 2020 and I was considering the following. I want to filter by month for some analysis in my 2020 database. So how could I do for example filter with a measure to only select information up to August 2020?

Thank you for your time,

 

3 Replies

  • Shackwell , Use a slicer

     

    or measure like 

     

    LMTD =
    var _min = eomonth(today(),-2)+1
    var _max1 = today()
    var _max = date(year(_max1),month(_max1)-1, day(_max1))
    return
    CALCULATE(sum('Table'[Qty]), FILTER(ALL('Table'),'Table'[Date] >= _min && 'Table'[Date] <=_max ) )

     

     

    • Shackwell's avatar
      Shackwell
      Helper III

      It kind of needs to be a measure so I can do calculations with another columns. I am rather new in the segment of measures. Any chance I could get a detailed explanation on the formula?

      Just a brief explanation of the concepts used in there.

      Thank you,

  • Hi, Shackwell 

     

    Not too clear what you mean, do you want to filter the data in the database or in the power bi. Better have an example here to let us know what kind of measures you need, and if you can describe in detail what you want to achieve, maybe I know some relevant information.

     

    How to provide sample data in the Power BI Forum

    How to Get Your Question Answered Quickly

     

     

    Best Regards,
    Community Support Team _ Zeon Zheng
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.