Forum Discussion

Divya904's avatar
Divya904
Helper III
8 years ago
Solved

Filtering a table with user entered input date

Hi Experts

 

Please help me to find how we can filter a table based on user entered date.

 

I have created a new 'Date' table in Power BI which gives me a 'date field'.  I have created a slicer using 'Date' field in my report. 

Now when the user selects a single date in the slicer, my table should get filter according to that.

 

There are some DAX calculations in the table like Total Sales and some DAX buckets. 

 

Thanks in advance.

 

Regards

  • Hi,

     

    Ensure that the relationship is from the OrderDate column of the Sales Table to the Date column of the Calendar Table.  Also, the relationship status should be active.  Furthermore, you should be able to simplify your formula to:

     

    =if([PostingDate - User Input Date]<0,CALCULATE(Sum('Sales'[Amount ]),[WhatIsTheAge]>=1,[WhatIsTheAge]<31,[Item Status] = "O"),0)

8 Replies

  • anandav's avatar
    anandav
    Skilled Sharer

    Divya904,

    Have you estblished relationship between your fact table and the 'Date' table?

    You need to establish the relationship so that the Date slices selction can filter your fact table.

    • Divya904's avatar
      Divya904
      Helper III

      Hi Anandav

       

      Thanks for replying back.

       

      yes, i have established a relationship between fact table and 'Date' table

       

      Thanks