Forum Discussion

ravitejaballa's avatar
ravitejaballa
Helper III
6 years ago

Slicer With single selection

Hi,

I have a data like below,

where "Months Since Started" is months difference with current date => (TodayMonth - startDateMonth)

Now i want to have slicer on report which filters

1. Contract expirying with in 6 months => Shows Devices = A, C, D, E

2. Contract expirying with in 3 months => Shows Devices = A, D

3. Contract expirying with in 1 month => Shows Devices = E

Note: Slicer will be single selection

 

DeviceContract Start DateMonths Since Started
A17-Dec-193
B21-Sep-1818
C15-Oct-195
D14-Jan-202
E16-Sep-196

 

11 Replies

  • You can get this by rolling months

    Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-6,MONTH))  
    Or
    Rolling 6 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],Today(),-6,MONTH))  
    //3
    Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-3,MONTH))  
    Or
    Rolling 3 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],Today(),-3,MONTH))
    //1
    Rolling 1 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],MAX(Sales[Sales Date]),-1,MONTH))  
    Or
    Rolling 1 = CALCULATE(sum(Sales[Sales Amount]),DATESINPERIOD('Date'[Date Filer],Today(),-1,MONTH))    
    

     

    You can use a slicer like this to handle these measures

    https://community.powerbi.com/t5/Desktop/Slicer-MTD-QTD-YTD-to-filter-dates-using-the-slicer/td-p/500115

     

  • dax's avatar
    dax
    Community Support

    Hi ravitejaballa , 

    I don't know your slicer style, you could refer to my sample for details. If this is not waht you want, please correct me and inform me more detailed information(such as your expected output and your sample data)? Then I will help you more correctly.

    Please do mask sensitive data before uploading.

    Thanks for your understanding and support.
    Best Regards,
    Zoe Zhi

    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

    • ravitejaballa's avatar
      ravitejaballa
      Helper III

      dax Ashish_Mathur amitchandak 

      Here is my sample data.

       

      DeviceContract Start DateMonths Since Started
      A17-Dec-193
      B21-Sep-1818
      C15-Oct-195
      D14-Jan-202
      E16-Sep-196

       

      IndexContract expirying
      1with in 6 months
      2with in 3 months
      3with in 1 month
       

       

      So Slicer should filter table as below.

      1. Contract expirying "with in 6 months" => Shows Devices = A, C, D, E

      2. Contract expirying "with in 3 months" => Shows Devices = A, D

      3. Contract expirying "with in 1 month" => Shows Devices = C, E

      • Ashish_Mathur's avatar
        Ashish_Mathur
        Super User

        Hi,

        That is exactly what my solution does.  I have shared the file with you.