Supplies are limited. Contact info@espc.tech right away to save your spot before the conference sells out.
Get your discountScore big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount
Hi,
I wanto to created Current Week based on the Max Selected Year and Month, and the previous Week based on the Min Selected Year and Month. like this
i already created measure for Current week like this :
but the result comes like this
Solved! Go to Solution.
@adityo Well done, you're getting close. You'll need to add a Week Number column to your date table also, this can be done in Power Query.
Then, see if this blog helps: Calculating Weekly Sales w/DAX In Power BI | Enterprise DNA
Finally come back and let me know how you're getting on and what further questions you still have.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
@adityo You'll need to create a Week Offset or Year Week merged column that tells Power BI to put Week 53 of the previous year before Week 1 of this year. Radacad have a simple starting script to help with this https://radacad.com/offset-columns-for-the-date-table-flexibility-in-relative-date-filtering-for-pow...
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
could you give example how to do this, or could you modify from my measure, because I'm sure, the data model is different.
Thank you
@adityo Yes, the data model is different, that's the issue. You need to add a column to your data model. You need to build a date table. The link I provided has a link to download a txt file you can use for the date table you'll need.
Here's my blog on why you need Date table: https://excelwithallison.blogspot.com/2020/04/dimdate-what-why-and-how.html but it doesn't include the Offset column you need.
So download the M advanced editor from here: https://radacad.com/download/13519/
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi @AllisonKennedy ,
Im totally newbie here, here the screenshot what i do,
i created the table and linked it, what is the next steps?
@adityo Well done, you're getting close. You'll need to add a Week Number column to your date table also, this can be done in Power Query.
Then, see if this blog helps: Calculating Weekly Sales w/DAX In Power BI | Enterprise DNA
Finally come back and let me know how you're getting on and what further questions you still have.
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com