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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
clmigeon
Frequent Visitor

Sum on different date

Hi all, 

I have two table : 

The 1st with my societe_Id , the cost and the cost date

IdCostDate
187125000

01/01/2019

187255000

01/02/2020

186255000

01/01/2021

187155000

21/01/2021

 

the 2nd with a périod 

Idstart date

end date

18701/01/20

31/12/20

18601/07/20

31/06/20

 

I want to calculate the sum of each cost between the date of the 2nd table. 
I don't find how to, could someone help me ? 

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@clmigeon , A new column table 2

 

new column in Table 2 = sumx(filter(Table1, Table1[ID] = Table2[ID] && Table1[Date] >=Table2[Start Date] && Table1[Date] <= Table2[End DATE]),Table1[Cost])

View solution in original post

1 REPLY 1
amitchandak
Super User
Super User

@clmigeon , A new column table 2

 

new column in Table 2 = sumx(filter(Table1, Table1[ID] = Table2[ID] && Table1[Date] >=Table2[Start Date] && Table1[Date] <= Table2[End DATE]),Table1[Cost])

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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