The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hello dear community; I hope you are doing well 😀
I have a power BI report that is using a Live connection on a tabular model.
I have created a power bi report page that must display data only for the last 13 weeks.
my data model doesn't contain a date table; it only consists on a one big table that conatains all the necessary fields including date fields ( Year, Semester, Month and Week) and there is no day field ( I dont have the possibility to bring it in my data model)
I created the following calculated column ( flag) that I put it in a slicer :
last 13 weeks= IF ( '360ST'[YearWeek] >= MAX ('360ST'[YearWeek]) - 13 , "1", "0")
the flag doesn't work. I note that the format of Week field is YYYYWW
I appreciate any help please, thanks
Hi @Anonymous ,
You say you have Year and Week in separate date fields, I would create a calculated column with the Start Date of the Week and, then, use it to calculate the difference in weeks from its max value. From there you can move on filtering your report based on this value making sure it works when changing the year (from 2020 to 2021).
ISO Start of week formula thanks to @wgarn
Regards,
User | Count |
---|---|
17 | |
8 | |
7 | |
6 | |
6 |
User | Count |
---|---|
26 | |
13 | |
12 | |
9 | |
8 |