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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
streep1
Regular Visitor

Current Week Number, for current year

Hello

 

I've been trying to work out the latest week number for the current financial year. My data has 'week number' in one column, and the period (year) in another - The years are described as FY2020-21 and FY2021-22.

 

I've been using (below) to find the current week number, but now as we have new data for the new year i am struggling to work up how to factor in the 'year' into the query ... Any tips would be great 🙂

 

Current Week Count =
VAR CurrWeek =
MAX(DATA[Week No])
RETURN
CALCULATE(
SUM(DATA[Filter]),
FILTER(ALLSELECTED(DATA),[Week No]=CurrWeek),
VALUES(DATA[Tower]),
VALUES(DATA[priority])
)

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@streep1 , Try like this

 

Current Week Count =
VAR CurrYear =
MAXX(allselected(Data),DATA[Year])
VAR CurrWeek =
MAXX(Filter(allselected(Data), DATA[Year] =CurrYear),DATA[Week No])
RETURN
CALCULATE(
SUM(DATA[Filter]),
FILTER(ALLSELECTED(DATA),[Week No]=CurrWeek && DATA[Year] =CurrYear),
VALUES(DATA[Tower]),
VALUES(DATA[priority])
)

 

 

Or you can have year week column and take a max for it

 

Year week = [Year]*100 +[Week]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

3 REPLIES 3
hansreivers
Helper I
Helper I

Hi all, I have a column in the calendertable which says which week it is; how can I retrieve this weeknumber as a number in power bi with a measure?

 

For example, this day, the corresponding weeknumber should be 40. I think it should be very easy... but I can't get it... Thanks in advance for the help.

amitchandak
Super User
Super User

@streep1 , Try like this

 

Current Week Count =
VAR CurrYear =
MAXX(allselected(Data),DATA[Year])
VAR CurrWeek =
MAXX(Filter(allselected(Data), DATA[Year] =CurrYear),DATA[Week No])
RETURN
CALCULATE(
SUM(DATA[Filter]),
FILTER(ALLSELECTED(DATA),[Week No]=CurrWeek && DATA[Year] =CurrYear),
VALUES(DATA[Tower]),
VALUES(DATA[priority])
)

 

 

Or you can have year week column and take a max for it

 

Year week = [Year]*100 +[Week]

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks, for the fast reply that worked a treat!

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors