Forum Discussion
Custom Week Number for specific Date Range
- 6 years ago
Like
Week = format([Week Start date],"dd/mm/YYYY") & " to "& format([Week End date],"dd/mm/YYYY")If you need set that as date format : https://community.powerbi.com/t5/Desktop/How-to-apply-UK-date-format-dd-mm-yyyy-in-Date-slicer/td-p/599712
Create in your date table like
Week Start date = 'Date'[Date]+-1*WEEKDAY('Date'[Date])+1
Week End date = DATEADD('Date'[Date],7-1*WEEKDAY('Date'[Date]),DAY)
Week = [Week Start date] & " to "& [Week End date]
Also refer : https://www.dropbox.com/s/d9898a48e76wmvl/sales_analytics_weekWise.pbix?dl=0
use format on dates if needed
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :
https://radacad.com/creating-calendar-table-in-power-bi-using-dax-functions
https://www.archerpoint.com/blog/Posts/creating-date-table-power-bi
https://www.sqlbi.com/articles/creating-a-simple-date-table-in-dax/
amitchandak Thank you for your effort.
There is a small progress but still not completed. These weeks are not sorted on my graph.
So is there any week to sort it with correct dates ?
Thanks in advance!!!
- amitchandak6 years agoSuper User
- SpiroswayGR6 years agoResolver III
amitchandak Thanks very much!!
Almost complete my solution but still 2 remaining things...
1st : Is it possible to show dates as "DD/MM/YYYY" instead of "MM/DD/YYYY"?
2nd : Is it possible to visualize on same weekly graph metrics for this week year and metrics for Last week year ?
for example : Week for this year : 10/02/2019 to 17/02/2019 with Sum metric = 1000 and last year metric : 10/02/2018 to 17/02/2019 with sum metric : 500
Thanks again!!
- amitchandak6 years agoSuper User
Like
Week = format([Week Start date],"dd/mm/YYYY") & " to "& format([Week End date],"dd/mm/YYYY")If you need set that as date format : https://community.powerbi.com/t5/Desktop/How-to-apply-UK-date-format-dd-mm-yyyy-in-Date-slicer/td-p/599712