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

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

Reply
ULTRAVI0LENCE
New Member

Week Over Week DAX Count for Previous Week

I've created a measure that uses calculated columns that counts rows with a specific value, see below.

 

Calls This Week = CALCULATE(COUNTROWS(AllContacts),FILTER(AllContacts,AllContacts[Contact_System]="Call Center"),FILTER(ALL(AllContacts),AllContacts[WeekRank]=MAX(AllContacts[WeekRank])))
 
This expression works & gives me an accurate number of calls for a given week with the filter applied for only rows with "Call Center". The next step would be to calculate the same data for the previous week. The DAX I wrote for that purpose is very similar below, but does not return anything.
 
Calls Last Week = CALCULATE(COUNTROWS(AllContacts),FILTER(AllContacts,AllContacts[Contact_System]="Call Center"),FILTER(ALL(AllContacts),AllContacts[WeekRank]=MAX(AllContacts[WeekRank])-1))
 
I subtract 1 from the week rank to return the previous week, but this does not prove to be useful. Anyone familiar with this issue?
 
2 REPLIES 2
FreemanZ
Super User
Super User

Hi @ULTRAVI0LENCE ,

 

try like:

CountPreviousWeekColumn= 
COUNTROWS(
    FILTER(
        AllContacts,
        AllContacts[Contact_System]="Call Center"
            &&AllContacts[WeekRank] = EARLIER(AllContacts[WeekRank]) -1
    )
)

Thank you for the reply,

 

The EARLIER DAX expression does not accept my column AllContacts[WeekRank] as a parameter. An error is thrown on this specific parameter. Any tips on this?

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.