Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
heygau
Helper I
Helper I

Financial Sale Week Number on Card

I am looking for DAX Help 



I have a Calendar Table which has Weeknumber and Financial Sale Week Number 

On Main DashBoard - I need to Show Three Cards Visuals - which Shows OR One Multi Card

1) First Sale Week of the Month 
2) Current Sale Week 
3) Last Sale week of the Month Screenshot (114).png

 

Screenshot (116).png

3 REPLIES 3
danextian
Super User
Super User

hi @heygau ,

 

It will depend on whether your current month is based on today's date or the max date as selected in the slicer. For example, what is the max date in FY23.










Did I answer your question? Mark my post as a solution!


Proud to be a Super User!









"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

@danextian  Dash Board has an option to choose Year and Month only, Once we choose Month cards shouls show First Week of the month and  Max week of the month and current week of the month 

amitchandak
Super User
Super User

@heygau , if you need based on today

 

WTD Today =
var _min = TODAY() -WEEKDAY(TODAY(),2) +1 //Monday week start
var _max = today()
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

LWTD Today =
var _min = TODAY() -WEEKDAY(TODAY(),2) -6 //Monday week start
var _max = today() -7
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

LYWTD Today =
var _max = today() -364
var _min = _max -WEEKDAY(_max,2) +1//Monday week start
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

WTD Yesterday =
var _max = today() -1
var _min = _max -WEEKDAY(_max,2) +1 //Monday week start
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

LWTD Yesterday =
var _max = today() -8
var _min = _max -WEEKDAY(_max,2) +1 //Monday week start
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

LYWTD Yesterday =
var _max = today() -364
var _min = _max -WEEKDAY(_max,2) +1//Monday week start
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

This Week Today =
var _min = today() -WEEKDAY(today() ,2) +1 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

Last Week Today =
var _min = today() -WEEKDAY(today() ,2) -6 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

Last year same week Today =
var _today = today() -364
var _min = _today -WEEKDAY(_today,2) +1//Monday week start
var _max = _min+6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

 

First week month Week Today =
var _date = eomonth(today(),-1)+1
var _min = _date-WEEKDAY(_date ,2) +1 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER('Date','Date'[Date] >=_min && 'Date'[Date] <= _max))

 

 

If you need based on selected value

 

Have these new columns in Date Table, Week Rank is Important in Date/Week Table

Week Rank = RANKX(all('Date'),'Date'[Week Start date],,ASC,Dense)
OR
Week Rank = RANKX(all('Date'),'Date'[Year Week],,ASC,Dense) //YYYYWW format
WeekDay = weekday([Date],2)

These measures can help
This Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])))
Last Week = CALCULATE(sum('Table'[Qty]), FILTER(ALL('Date'),'Date'[Week Rank]=max('Date'[Week Rank])-1))

 

First week month Week Today =
var _date = eomonth(max('Date'[Week Rank]),-1)+1
var _min = _date-WEEKDAY(_date ,2) +1 //Monday week start
var _max = _min +6
return CALCULATE([Net], FILTER(all('Date'),'Date'[Date] >=_min && 'Date'[Date] <= _max))

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.