The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi everyone,
I'm new to Power BI and I'm having some trouble connecting to a PostgreSQL database and importing the data.
Background:
My question is: which is the most eficient way to filter this data?
Thanks in advance for your help!
Solved! Go to Solution.
Hello @Divinal_ThiagoP,
You could write a query that joins your target table with the date-containing table and filters based on the date:
SELECT t.*, d.date_field
FROM target_table t
JOIN date_table d ON t.date_id = d.id
WHERE d.date_field >= CURRENT_DATE - INTERVAL '2 years'
Hope this helps!
Hello @Divinal_ThiagoP,
You could write a query that joins your target table with the date-containing table and filters based on the date:
SELECT t.*, d.date_field
FROM target_table t
JOIN date_table d ON t.date_id = d.id
WHERE d.date_field >= CURRENT_DATE - INTERVAL '2 years'
Hope this helps!
User | Count |
---|---|
78 | |
77 | |
37 | |
33 | |
31 |
User | Count |
---|---|
93 | |
81 | |
59 | |
49 | |
48 |