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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
areias_br
Helper I
Helper I

Count Rows with Date Condition

Hi,

I have a table called "Actions" and another table called "tb_Calendar" which is a calendar table. 

 

Action Name | Created Date | Closed Date | Status (Open or Closed)

 

I need a view were I can see the amount of actions that were opened during a period. 

It should show that in January I had 40 actions opened, February 30, etc...THis is based on the Created Date and Closed Date collums. 

The problem is that i'm only getting the number of actions that were opened during that period and not the amount of all actions that were opened during that period.

 

 

2 ACCEPTED SOLUTIONS
Ashish_Mathur
Super User
Super User

Hi,

I just responded to a similar post here.  Please see the link which i have shared there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

View solution in original post

It was not the perfect solution, but helpmed to have a insight on how to solve the question.

I created a table based on this tutorial with all the Weeks from my calendar table.
https://gorilla.bi/power-query/date-table-with-monthly-increments/

Them I used Added a Collum:
Opened Actions =
COUNTROWS(
FILTER(
'AllActions',
'AllActions[Created Date] < 'tb_Followup '[Date] && ('AllActions[Closed Date] > 'tbFollowup'[Date] || 'AllActions[Closed Date] = BLANK())
))

View solution in original post

4 REPLIES 4
Ashish_Mathur
Super User
Super User

Hi,

I just responded to a similar post here.  Please see the link which i have shared there.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

It was not the perfect solution, but helpmed to have a insight on how to solve the question.

I created a table based on this tutorial with all the Weeks from my calendar table.
https://gorilla.bi/power-query/date-table-with-monthly-increments/

Them I used Added a Collum:
Opened Actions =
COUNTROWS(
FILTER(
'AllActions',
'AllActions[Created Date] < 'tb_Followup '[Date] && ('AllActions[Closed Date] > 'tbFollowup'[Date] || 'AllActions[Closed Date] = BLANK())
))

ExcelMonke
Super User
Super User

You can consider the following:

Measure = 
CALCULATE (DISTINCTCOUNT(Actions[Action Name]), ALLEXCEPT(tb_Calendar[Month]),FILTER(Actions,Actions[Status]="Open"))

 

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!





Hi,

Thanks for the reply, but I believe it doesn't work.

The Status "Open" changes over time. So...In January an action might have been as "Open" and now It can show as "Closed".

I need to compare the dates.


Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.