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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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...

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
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

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

June 2025 community update carousel

Fabric Community Update - June 2025

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