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
Hey all,
I try to calculate next 4 weeks demands. But it doesn't depend on the standardized calendar but on the combo of year and week, such as 2022001 1st week of year 2022). For example, in week 1 2022, (2022001), my next 4 weeks demands should cover from 2022002 thru 2022005.
I initially set up as below, but that doesn't work for me. Any thoughts? Thanks!
Solved! Go to Solution.
Hi @naoyixue1
If you only use "[YearAnd Week]<=CurrentYearAndWeek+4" then the formula will consider all weeks before CurrentYearAndWeek+4 which is more than 4 weeks, to make it correct and keep it in the exact period you need to cap the lowest amount and highest amount.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
HI @naoyixue1
In your dax formula, in the filter try to write something like below:
Filter(all(table),[YearAnd Week]>=CurrentYearAndWeek&&[YearAnd Week]<=CurrentYearAndWeek+4)
rather that SELECTEDVVALUE you can use MAX.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
Hey Vahid,
Thanks for your help. I still see there is off for some calculation. But I think your logic is right. Would you mind explaining the login for below dax. Is that ok for me to only put "[YearAnd Week]<=CurrentYearAndWeek+4" In other words, why should we put "[YearAnd Week]>=CurrentYearAndWeek"? Thanks!
Filter(all(table),[YearAnd Week]>=CurrentYearAndWeek&&[YearAnd Week]<=CurrentYearAndWeek+4)
Hi @naoyixue1
If you only use "[YearAnd Week]<=CurrentYearAndWeek+4" then the formula will consider all weeks before CurrentYearAndWeek+4 which is more than 4 weeks, to make it correct and keep it in the exact period you need to cap the lowest amount and highest amount.
If this post helps, please consider accepting it as the solution to help the other members find it more quickly.
Appreciate your Kudos!!
LinkedIn: www.linkedin.com/in/vahid-dm/
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 |
---|---|
108 | |
78 | |
66 | |
52 | |
50 |
User | Count |
---|---|
121 | |
120 | |
78 | |
63 | |
62 |