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
Anonymous
Not applicable

SUMIF month < actual month

Hello everyone, I'm just starting with Power BI and Power Query and I'm trying to do a new measure like a SUMIF in Excel.

I tried to use Group By, but didn't work like I need.

 

I have rows with date and price, and I need to sum every line with date before the actual month. In excel I was using one Pivot Table, filtering every month except the current one. But i don't know the best way to do it here with BI.

Can anyone help me with a solution?

Thanks in advance 🙂

6 REPLIES 6
Dhacd
Resolver III
Resolver III

@Anonymous 
If I am Correct the second chart in the below screen snap is your desired outcome Right?

Dhacd_0-1654605145681.png

 

Anonymous
Not applicable

I'll print an exemple to explain what i'm trying to do:

 

I want to sum all "total values" if date is less than the current

victorpereira_0-1654606567991.png

 

It should return an chart like this:

victorpereira_1-1654606585771.png

 

In excel I used the function: =SUMIF([date];"<="&[@date];[total])

 

But I'm looking an way to do it inside Power Query

Ohh you want a running total. In this case, you need to create a calculated column. 
Running total = calculate(sum(total),filter(table,earlier(date)>=date))
Try this formula in your context. This might be working. If not comment and I will look into it.

 

Anonymous
Not applicable

I'm sorry, I think I'm doing something wrong.. it didn't work.

victorpereira_0-1654615026557.png

 

Returned this error when I tried to create the calculated column. I just switched the names in the formula by the names of my columns.

Dhacd
Resolver III
Resolver III

Hi @Anonymous,

I believe the result should be in a table visual right?
If yes please reply I have a solution.

Anonymous
Not applicable

I'm trying to create a line chart with these data. Is it what are you asking?

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

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

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.