The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event: Join us in Stockholm, September 24-27, 2024.
Save €200 with code MSCUST on top of early bird pricing!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
Hi all,
I've created a visual comparing last years sales with sales from this year, with week number on the X axis. My issue is that PBI includes all weeks from last year, as you can see on the image. What I want it to do, is only show the data up until today/as far as the blue columns go on the chart.
The week numer comes from my date table and the values are just taken from a field in the sales table, no measures have been used.
Solved! Go to Solution.
Hi @Joachim2108 ,
Do you have a calendar table with date, year and week columns?
You may add a visual-level filter. Here's the solution.
Create a measure.
Measure = IF(WEEKNUM(TODAY())>=WEEKNUM(MAX('Calendar'[Date])),1)
Add the measure in to the visual level filters and set show items when the value is 1.
You can check more details from my attachment.
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 @Joachim2108 ,
Do you have a calendar table with date, year and week columns?
You may add a visual-level filter. Here's the solution.
Create a measure.
Measure = IF(WEEKNUM(TODAY())>=WEEKNUM(MAX('Calendar'[Date])),1)
Add the measure in to the visual level filters and set show items when the value is 1.
You can check more details from my attachment.
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.
Thanks a lot Stephen. Works perfectly.
Take a look at this article that goes through how to hide the extra dates.
https://www.sqlbi.com/articles/hiding-future-dates-for-calculations-in-dax/
Unfortunately this only works if you're trying to show YTD figures/cumulative values. I only need to show the sales figures for each week up until this point, but thanks for the quick reply.
@Joachim2108 , Change you last is measure like
last year new =
if(isblank([This year]), blank() , [Last year])
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the August 2024 Power BI update to learn about new features.
User | Count |
---|---|
109 | |
80 | |
71 | |
51 | |
50 |
User | Count |
---|---|
123 | |
119 | |
76 | |
64 | |
60 |