Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
I'm currently trying to create a page filter for all of my charts in Direct Query.
The filter I need is the start of the week date . As I'm using Direct Query I can't manually enter start of the week dates e.g.
01/04/2019 | 1 |
08/04/2019 | 2 |
15/04/2019 | 3 |
So I've created a datekey via this code:
SoW Index = SUMMARIZE(DateKey, DateKey[WeekStartDate])
Index = RANKX(ALL('SoW Index'),'SoW Index'[WeekStartDate],,ASC)
And created a relationship to my core table with this new (piggyback) table:
Hi, @Anonymous
Based on your description, I created data in SQL SERVER to reproudce your scenario.
SOW:
Then I connected to the data source with Direct Query mode. I created a calculated table and a calculated column as below.
Calculated table:
DateKey = CALENDAR(DATE(2019,1,1),DATE(2020,12,31))
Calculated column:
WeekStartDate = DateKey[Date]-WEEKDAY(DateKey[Date],2)+1
There is a relationship between two tables based on 'Date' column.
Result:
Best Regards
Allan
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous , Join SOW of Table with Date of Date Table. Start of Week in calendar/Date will take care of Display
However it's still not working. Can anyone advise on how to build start of the week date tables in Direct Query?
Thanks
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
111 | |
96 | |
80 | |
68 | |
59 |
User | Count |
---|---|
150 | |
119 | |
104 | |
87 | |
67 |