Forum Discussion
how to filter a dataset tables using date filter
Hi team,
I have imported the data using Power BI Datasets into my power bi desktop. but i want to restrict the data between specific dates using slicer (if we select different date source data needs to be change) or parameter because the data is having millions of records. But those specific dates will change every week.
example: if user selects the data for 15th jan 2021. the datasets data should be change for 15th jan 2021 only
can you guys help me out on this
Thanks & Regards,
B V S Sudhakar
Hey Anonymous ,
this is exactly what you can do with a date table.
You connect it to all 3 tables and then you slice on the date table. All the underlying tables will then adapt.
Why don't you combine the 3 tables to one table? This should solve a lot of issues.
Check here how you can join multiple tables into one:
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.bi
3 Replies
- selimovd
Most Valuable Professional
Hey Anonymous ,
you need a date table to do that.
Try the following tutorial and then use the slicer with the columns from the new date table:
Power Bi for Beginners: How to create a Date Table in Power Bi - Softcrylic
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.bi- AnonymousNot applicable
hi selimovd ,
Thank you for your reply. Let me explain the whole problem
I have 3 tables in my powerbi desktop named as
Current (selected date to before 90 days)
Previous (before current table 90 days i.e. 91 to 180)
Lastyear current (means same period last year for current table )For these 3 datasets source query is same i.e.
Select s.*,d.weekend,d. date from sales s left join date d on s.datekey = d. idNow we have to give weekend as slicer for user
if he selects 23rd jan date from slicer data should filter like this for user
For current dataset 23rd jan 2021 to before 90 days
For previous dataset 91st day from 23rd jan to 180 days
For last year current dataset 23rd jan 2020 to 90 daysHow to achieve this? I am not able get any idea... can you please help me out on this
I can't use single dataset because the reports are already developed using excel sourceNow . we have to connect to database. To connect database we have to write same views
- selimovd
Most Valuable Professional
Hey Anonymous ,
this is exactly what you can do with a date table.
You connect it to all 3 tables and then you slice on the date table. All the underlying tables will then adapt.
Why don't you combine the 3 tables to one table? This should solve a lot of issues.
Check here how you can join multiple tables into one:
If you need any help please let me know.If I answered your question I would be happy if you could mark my post as a solution ✔️ and give it a thumbs up 👍Best regardsDenisBlog: WhatTheFact.bi