Countifs or sumproducts with date in Power Pivot

reggieneo

New Member
Joined
Jun 27, 2017
Messages
26
Hi All,
How can I do Countifs or Sumproduct of dates in dax/power pivot?

I have multiple columns with 2 dates columns.
I need to count the rows that meets the 2 dates criteria of status.

Criteria and objective: Count the rows if reported date is before status date; and other criteria is the current row of status date.

my data model has date table.


My challenge is getting the current row in Status date as criteria. Please see the sample data for more reference.

[TABLE="width: 567"]
<tbody>[TR]
[TD]Reported Date[/TD]
[TD]Status Date[/TD]
[TD]Countifs[/TD]
[TD]Results[/TD]
[/TR]
[TR]
[TD="align: right"]6/1/2019[/TD]
[TD="align: right"]6/10/2019[/TD]
[TD]=COUNTIFS($A$2:$A$20,"<"&B2,$B$2:$B$20,B2)[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]6/2/2019[/TD]
[TD="align: right"]6/4/2019[/TD]
[TD]=COUNTIFS($A$2:$A$20,"<"&B3,$B$2:$B$20,B3)[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]6/2/2019[/TD]
[TD="align: right"]6/3/2019[/TD]
[TD]=COUNTIFS($A$2:$A$20,"<"&B4,$B$2:$B$20,B4)[/TD]
[TD="align: right"]1[/TD]
[/TR]
[TR]
[TD="align: right"]6/6/2019[/TD]
[TD="align: right"]6/10/2019[/TD]
[TD]=COUNTIFS($A$2:$A$20,"<"&B5,$B$2:$B$20,B5)[/TD]
[TD="align: right"]2[/TD]
[/TR]
[TR]
[TD="align: right"]6/6/2019[/TD]
[TD="align: right"]6/6/2019[/TD]
[TD]=COUNTIFS($A$2:$A$20,"<"&B6,$B$2:$B$20,B6)[/TD]
[TD="align: right"]0[/TD]
[/TR]
</tbody>[/TABLE]


much thanks
 

Excel Facts

Quick Sum
Select a range of cells. The total appears in bottom right of Excel screen. Right-click total to add Max, Min, Count, Average.

Forum statistics

Threads
1,226,148
Messages
6,189,261
Members
453,534
Latest member
OpsDirJD

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top