Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Is there a simple way to filter to the latest 4 weeks for sales in a measure but i dont have a date table and wont as i am working with week numbers so i just want to look at the sales associated with the 4 latest week numbers. I can do this via the TopN function but need it in a measure format
Solved! Go to Solution.
Hi @Anonymous ,
Since you connection mode is live connection, you can create a calendar table by DAX.
For example:
Table = CALENDAR(DATE(2020,1,1),DATE(2020,12,31))
Then create a relationship between your main table and the new calendar table.
Put Date column in the calendar table into Filters on this visual or all pages and it should do the job.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Stephen Tao
Hi @Anonymous ,
Since you connection mode is live connection, you can create a calendar table by DAX.
For example:
Table = CALENDAR(DATE(2020,1,1),DATE(2020,12,31))
Then create a relationship between your main table and the new calendar table.
Put Date column in the calendar table into Filters on this visual or all pages and it should do the job.
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@Anonymous
I recommend you set up a period table covering the range for the Year, Week, and YearWeek in your dataset. Include an index column for the YearWeek column. Create a relationship between the YearWeek column in your period table and an equivalent YearWeek column in your fact table.
You can then use this index to subtract 4 weeks in your measures.
If you can provide a sample dataset I can work on the example for you.
Proud to be a Super User!
Paul on Linkedin.
@PaulDBrown as this is live connection i dont have capacity to do this i am only able to create measures in the Power bi. so am looking to find a way to filter to latest 4 weeks based on dates that are weekending dates
User | Count |
---|---|
90 | |
74 | |
67 | |
63 | |
55 |
User | Count |
---|---|
101 | |
92 | |
74 | |
60 | |
59 |