Join us for an expert-led overview of the tools and concepts you'll need to pass exam PL-300. The first session starts on June 11th. See you there!
Get registeredPower BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.
Hello!
I would like to know if it is possible to avoid having duplicate weeks, by taking the data at a granularity level from month to week?
For example, in the graph it shows week 5 in both January and February, and it looks like sales fell in the last week of January, when they did not. The x-axis is Month and week
The dax I use is a calculation of sales for the current year:
Sales curr year = CALCULATE ([Sales], FILTER ( 'Calendar', 'Calendar'[Offset Year] = 0 ))
Solved! Go to Solution.
Hi @x-datita
Please try this:
I create a set of sample:
Then create a measure:
Measure =
VAR _currentweek = MAX('Table (2)'[week])
RETURN
CALCULATE(
SUM('Table (2)'[value]),
FILTER(
ALLSELECTED('Table (2)'),
'Table (2)'[week] = _currentweek
)
)
The result is as follow:
Use the all(), allselected(), allexcept(), and removefilter() functions to remove unwanted filtering effects.
Here's a blog about contextual filtering
Understand the Filter Context and How to Control i... - Microsoft Fabric Community
Best Regards,
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @x-datita
Please try this:
I create a set of sample:
Then create a measure:
Measure =
VAR _currentweek = MAX('Table (2)'[week])
RETURN
CALCULATE(
SUM('Table (2)'[value]),
FILTER(
ALLSELECTED('Table (2)'),
'Table (2)'[week] = _currentweek
)
)
The result is as follow:
Use the all(), allselected(), allexcept(), and removefilter() functions to remove unwanted filtering effects.
Here's a blog about contextual filtering
Understand the Filter Context and How to Control i... - Microsoft Fabric Community
Best Regards,
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thank you so much it works great!!
An additional question, do you know if it is possible to take week 52 as the first week in the display, only when it appears in January?
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
76 | |
75 | |
56 | |
38 | |
33 |
User | Count |
---|---|
99 | |
56 | |
51 | |
44 | |
40 |