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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Thedatadude
Frequent Visitor

Need two measures last weeks total of assignments and w/e the current weeks

Hey guys I am trying to use the KPI indicator visual. I need two measures one that pulls the active contracts of whatever the current week is by customer and one that pulls active contracts from the week prior of that current week to compare week over week growth. In this dataset I do have PayperiodEndDates that are in future weeks to account for open contracts that end later in the year.  I am working on building a measure but admittedly my dax isn't as strong as my SQL skills.  I have table that looks like this

CustomerPayPeriodEndDateActiveContractsWeekNumberYear
Little Guys Tires5/20/20201212020
Little Guys Tires5/27/20202222020
Little Guys Tires9/20/20201412020
Big Bobs Wings6/14/20201292020
Big Bobs Wings6/21/20201302020
Big Bobs Wings 7/19/20201362020

This is what I have thus far but I'm getting an error on WEEKNUMBER being the wrong format/don't know if this is the most optimized way 

LastWeek =
CALCULATE(SUM(ActiveAssignmentDemension[ActiveAssignments]),FILTER(ALLEXCEPT(ActiveAssignmentDemension,ActiveAssignmentDemension[CustomerName],ActiveAssignmentDemension[WEEKNUMBER]= WEEKNUM(TODAY(),1)-1)))
2 REPLIES 2
amitchandak
Super User
Super User

@Thedatadude , refer my blog on WOW

https://community.powerbi.com/t5/Community-Blog/Week-Is-Not-So-Weak-WTD-Last-WTD-and-This-Week-vs-La...

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

I HAVE WEEK ENDING DATES THAT ARE LATER IN THE YEAR THEN THE CURRENT ONES. DATES THAT ARE IN THE FUTURE. 

 

PLS HELP.

SORY 4 CAPS 

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

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.