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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

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
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

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