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
Hayleysea
Resolver II
Resolver II

Last available week measure not returning correct value

I have data which is usually updated weekly but sometimes it would skip a few weeks.

 

I need a measure that I can use the compare a percentage measure from the current week to the last available week (not necessarily -7 days). 

 

I have a measure that works to give me just the date output which is: 

Last week date: CALCULATE(MAX(Table[Date]), FILTER(ALL(Table[Date]), Table[Date]<MAX(Table[Date]))
 
I also have a measure which works to give me the current week's % which is:
% Measure = IF(ISBLANK(COUNTX(FILTER(Table, Table[Latest Week Cond Form]=2), Table[code])/ COUNTX(FILTER(Table, Table[Count]="Yes"), Table[code])), "-", COUNTX(FILTER(table, table[latest Week Cond Form]=2), table[code])/ COUNTX(FILTER(Table, Table[Count]="Yes"), Table[code]))
 
I now need a measure that will give me last week's %. What I have so far is:
CALCULATE(([% Measure]), FILTER(ALL(Table[Date]), Table[Date]<MAX(Table[Date])))
 
It's giving me a percentage but not the right one. All the correct filters have been applied so I have no idea why it's not working. 
1 REPLY 1
v-lili6-msft
Community Support
Community Support

HI @Hayleysea 

Add a weeknum column for date column, then just refer to this post:

https://community.powerbi.com/t5/DAX-Commands-and-Tips/DAX-Rolling-WoW-with-Week-Numbers-no-Dates/td...

If you still have the problem, please share some sample data and your expected output.

https://community.powerbi.com/t5/Community-Blog/How-to-Get-Your-Question-Answered-Quickly/ba-p/38490

 

Regards,

Lin

Community Support Team _ Lin
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

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