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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
AndreaA4S
New Member

Count number of rows that were active each month and add to summary table

I have two tables one with a row for each month of the year, the other is the table of project members with start dates and end dates. I need to add a column in the first table to count how many active project members there were each month.

I tried this:

# Members = COUNTAX('7 Expert Panel data',and(('7 Expert Panel data'[EOM Start]<='0 Summary table'[Month end]),(OR(ISBLANK([EOM End]),('7 Expert Panel data'[EOM End]>'0 Summary table'[Month end])))))

 

But to no avail! Please help 🙂

1 ACCEPTED SOLUTION
johnbasha33
Super User
Super User

@AndreaA4S 

  1. Iterate through each row in the summary table.
  2. For each row, count the number of project members from the project members table whose start date is before or equal to the current month end date in the summary table, and either have a blank end date or their end date is after the current month end date.

Here's how you can do it in Power BI using DAX:
Active Members =
VAR CurrentMonthEnd = '0 Summary table'[Month end]
RETURN
CALCULATE(
COUNTROWS('7 Expert Panel data'),
FILTER(
'7 Expert Panel data',
'7 Expert Panel data'[EOM Start] <= CurrentMonthEnd &&
(ISBLANK('7 Expert Panel data'[EOM End]) || '7 Expert Panel data'[EOM End] > CurrentMonthEnd)
)
)

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

View solution in original post

4 REPLIES 4
johnbasha33
Super User
Super User

@AndreaA4S 

  1. Iterate through each row in the summary table.
  2. For each row, count the number of project members from the project members table whose start date is before or equal to the current month end date in the summary table, and either have a blank end date or their end date is after the current month end date.

Here's how you can do it in Power BI using DAX:
Active Members =
VAR CurrentMonthEnd = '0 Summary table'[Month end]
RETURN
CALCULATE(
COUNTROWS('7 Expert Panel data'),
FILTER(
'7 Expert Panel data',
'7 Expert Panel data'[EOM Start] <= CurrentMonthEnd &&
(ISBLANK('7 Expert Panel data'[EOM End]) || '7 Expert Panel data'[EOM End] > CurrentMonthEnd)
)
)

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

Amazing thank you so much 🙂

@AndreaA4S  glad that it worked out for you. Keep exploring this forum for other issues.  🙂

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

Rupak_bi
Super User
Super User

Hi,

 

The syntax should work. plz share sample table schema and the dax. alternetive is to use userrelationship function to create relationship with two date column.



Regards
Rupak
FOLLOW ME : https://www.linkedin.com/in/rupaksar/

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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