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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Sum after a date

Hi, 

 

I'm trying to make a sum if formula (this is how I would solve it in Excel) or something similair in powerbi. 

I couldnt find a formula for or something else for this.  See the picture below for more clarity.

I have the spend per vendor per month in a different table.  With this data I want to sum the the spend after the enddate per vendor.  So something like IF[spend booked after enddate] = 'yes', Sum(spend per vendor month) after enddate.

I can't get this working. 

Alex_1999_0-1620043569809.png

Hope someone can help,

 

Thanks in advance! 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous , based on what I got. You have two tables

 

a new column in table 1

 

if(Table1[endDate] < maxx(filter(Table2, Table2[vendors] =table1[Vendors]),[spend date]), "Yes", "No")

 

refer 4 ways to copy data from one table to another
https://www.youtube.com/watch?v=Wu1mWxR23jU
https://www.youtube.com/watch?v=czNHt7UXIe8

Anonymous
Not applicable

@amitchandak Thanks a lot for your help. 

 

I'm sorry If my question was unclear. I indeed have two tables. One with most information as seen in the picture (lets call this table 1). Then I have a spend table with the spend per vendor per month. Now I want to sum the spend on a vendor after the enddate passed. So If spend booked after enddate = yes I want to sum the spend for that vendor. If spend booked after enddate is no, it can stay blank. 

 

I added a new column to table 1 and tried your formula. 

But I get the error: "Too many arguments were passed to the Filter function. The maximum argument count for the function is 2"

 

Thanks again for your help! 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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