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

How to "Sumif" From the same Table in DAX

I have historical sales data that I want to create a "Last Week Sales" column for. I was able to add a "Last Week" column successfully, and am trying to get the Last Week Sales column to work correctly, which needs to be a "Sumif" type of formula that works within its own table. LOOKUPVALUE isnt an option here since there will be multiple results per week.

GooseHelpful199_2-1702921323102.png

Any advice on how I can get this column to work? I tried using the below, but I can only get this type of formula to work if the data is on another table.

Last Week Sales = SUMX(FILTER(GRS, GRS[Week]=GRS[Last Week]),GRS[Sales])

1 ACCEPTED SOLUTION
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1702923373017.png

 

EARLIER function (DAX) - DAX | Microsoft Learn

 

Last week sales CC =
SUMX ( FILTER ( GRS, GRS[Week] = EARLIER ( GRS[Last Week] ) ), GRS[Sales] )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

1 REPLY 1
Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

 

Jihwan_Kim_0-1702923373017.png

 

EARLIER function (DAX) - DAX | Microsoft Learn

 

Last week sales CC =
SUMX ( FILTER ( GRS, GRS[Week] = EARLIER ( GRS[Last Week] ) ), GRS[Sales] )

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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