Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi all,
I've been browsing the internet for ways to show the current week of any given month but all I've come across is week number of the year. Is it possible to show week of the month? For instance, instead of week 31/32, it would be week 1 of August. This may pose a problem if weeks carryover from one month to another though. See my screenshot below for how it currently looks. Also, my existing DAX query is also below:
DAX formula:
Week = " Week " & WEEKNUM(VendDisplay[DateCreated], 2) & " - " & FORMAT(VendDisplay[DateCreated], "MMMM")
Any help is appreciated as always. Thanks!
Regards,
Derek
Solved! Go to Solution.
Hi @jderekc,
Try this column:
Week = " Week " & 1 + WEEKNUM ( VendDisplay[DateCreated] ) – WEEKNUM ( STARTOFMONTH ( VendDisplay[DateCreated] ) ) & " - " FORMAT(VendDisplay[DateCreated], "MMM")
If not works, my recomendation is to use a Calendar table linked to VendDisplay[DateCreated], and then change VendDisplay[DateCreated] to Calendar[Date] in this formula.
Hi @jderekc,
Try this column:
Week = " Week " & 1 + WEEKNUM ( VendDisplay[DateCreated] ) – WEEKNUM ( STARTOFMONTH ( VendDisplay[DateCreated] ) ) & " - " FORMAT(VendDisplay[DateCreated], "MMM")
If not works, my recomendation is to use a Calendar table linked to VendDisplay[DateCreated], and then change VendDisplay[DateCreated] to Calendar[Date] in this formula.
You are a genius, @Anonymous! I did it and now my bar chart returns "Week 1 - Aug", "Week 2 - Aug", et cetera. I did have to reformat the DAX formula just a little bit because it gave me an issue that completely failed its execution, but it was just a minor tweak. Thanks so much!
Regards,
Derek
It was missing an &. I adjusted it below and it worked fantatstic for me.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 45 | |
| 44 | |
| 20 | |
| 19 |
| User | Count |
|---|---|
| 73 | |
| 71 | |
| 34 | |
| 33 | |
| 31 |