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
rajrajsha
Frequent Visitor

Sumproduct with Power Query

Hi All,

In excel it is very easy to write sumproduct, but how to do the same formula with Power Query.

Belwo is my formula which goes in excel is 

=SUMPRODUCT((C2<=$D$2:$D$84000)*(D2>=$C$2:$C$84000)*(A2=$A$2:$A$84000))>1

I need to do the same formula with Power Query. Can some one help me in this case to write the code in PQ. For bette understanding i linked my data image and sample data below.

 

 

 

image.png

 

RepNumberTime InTime OutStatus
1380393/10/17 8:47 AM3/10/17 9:10 AMFALSE
1380253/10/17 1:34 PM3/10/17 2:14 PMFALSE
1381263/22/17 6:00 AM3/22/17 7:14 AMFALSE
1382174/14/17 6:33 AM4/14/17 7:33 AMFALSE
1382174/20/17 4:52 AM4/20/17 5:59 AMFALSE
1312418/30/19 3:11 PM8/30/19 3:29 PMFALSE
13128012/18/19 5:22 PM12/18/19 8:25 PMFALSE
1482554/28/17 6:03 PM4/28/17 7:26 PMFALSE
1483105/10/17 6:28 PM5/11/17 12:30 AMFALSE
1483385/16/17 3:09 PM5/16/17 7:26 PMFALSE
1483415/16/17 10:39 PM5/17/17 12:50 AMFALSE
1483415/17/17 12:51 AM5/17/17 1:27 AMFALSE
1483415/17/17 1:28 AM5/17/17 2:45 AMFALSE
1483605/22/17 12:47 PM5/22/17 2:05 PMFALSE
1483605/22/17 2:20 PM5/22/17 9:18 PMFALSE
1483675/24/17 7:37 PM5/24/17 9:04 PMFALSE
1483715/26/17 1:29 AM5/26/17 2:30 AMFALSE
1484166/6/17 6:22 PM6/6/17 8:45 PMFALSE
1483676/6/17 8:46 PM6/6/17 10:11 PMFALSE
1484416/13/17 11:27 AM6/13/17 1:17 PMTRUE
1483416/13/17 11:27 AM6/13/17 1:32 PMTRUE
1484476/13/17 1:18 PM6/13/17 1:50 PMTRUE
1484776/17/17 3:03 PM6/17/17 6:35 PMFALSE
1484476/27/17 11:06 PM6/28/17 1:05 AMFALSE
1485096/28/17 1:07 AM6/28/17 2:05 AMFALSE
1485577/11/17 6:10 PM7/11/17 8:01 PMTRUE
1485547/11/17 6:10 PM7/11/17 9:30 PMTRUE
1485577/24/17 7:56 PM7/24/17 10:59 PMFALSE
1486137/25/17 10:53 AM7/25/17 1:21 PMFALSE
1486337/31/17 1:42 PM7/31/17 5:13 PMFALSE
1486628/7/17 9:43 AM8/7/17 12:46 PMFALSE
1486628/9/17 8:56 PM8/9/17 9:25 PMFALSE
1486798/11/17 7:14 PM8/11/17 9:35 PMFALSE
1486628/21/17 3:56 PM8/21/17 5:22 PMFALSE
1488209/18/17 9:22 AM9/18/17 11:06 AMFALSE
1488139/18/17 11:07 AM9/18/17 11:21 AMFALSE
14887010/2/17 7:31 AM10/2/17 9:34 AMFALSE

 

Thanks for your support in this. 

1 ACCEPTED SOLUTION
v-frfei-msft
Community Support
Community Support

Hi @rajrajsha ,

 

Hope this case can help you.

https://www.myonlinetraininghub.com/excel-forum/power-query/countifs-or-sumproduct-in-power-query-or...

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

View solution in original post

2 REPLIES 2
v-frfei-msft
Community Support
Community Support

Hi @rajrajsha ,

 

Hope this case can help you.

https://www.myonlinetraininghub.com/excel-forum/power-query/countifs-or-sumproduct-in-power-query-or...

 

Community Support Team _ Frank
If this post helps, then please consider Accept it as the solution to help the others find it more quickly.

Hi 

 

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!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.