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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
abeinke2018
Frequent Visitor

sumifs formula with related tables

Data

 CalendarTable CropDataExcel Data

 

Hi All,

 

I am new to BI and have been using excel extensively, my issue is trying to sum amounts by day (given there is 000's of lines of data)

 

The types of formulas i have used are as below ...

 

Crop = CALCULATE(SUM(CropData[Kg]),FILTER(RELATEDTABLE(CropData),CropData[Date])<='Total Harvest'[Date]&&RELATEDTABLE(CropData),CropData[Date]>='Total Harvest'[Date])

 

Harvest = CALCULATE(SUM(CropData[Kg]),ALL('Total Harvest'[Date]))

 

 

What I am trying to get is the following (Excel)

 

=SUMIFS(L:L,B:B,">="&"Table Calander[Date]",B:B,"<="&"Table Calander[Date]",G:G,"GH 4")

 

Trying to reference the date field within the calendar table in order to summarise

 

Any help would be apreciated

 

Thankyou

 

Andrew

 

 

 

1295.jpg1288.jpg1289.jpg

2 REPLIES 2
v-yulgu-msft
Microsoft Employee
Microsoft Employee

Hi @abeinke2018,

 

1.PNG

What is the intention of above formulas?

 

Besides, to illuatrate the formula you used in Excel, please show us the desired result.

=SUMIFS(L:L,B:B,">="&"Table Calander[Date]",B:B,"<="&"Table Calander[Date]",G:G,"GH 4")

 

How to Get Your Question Answered Quickly

 

Best regards,

Yuliana Gu

Community Support Team _ Yuliana Gu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

I have this formula which gives me what I need, unless you know of a better way to do this ?

 

It sums up all the Kg's (000's of rows) for the location GH4 for each day

 

Field GH4 = CALCULATE(SUM(Field[GH4]),FILTER(ALL(Field),Field[Day]<='Total Harvest'[Date]&&Field[Day]>='Total Harvest'[Date]))

 

 

Thankyou

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 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.