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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
IWallis
Helper I
Helper I

Trying to calculate total member count by week (dynamic)


I have a data set with the account (member) and the membership end date (pic one), and I would like to create a bar chart with the week number as an x-axis and the total valid member count as Y (pic two), but the problem is if the membership ends I don't want the member to be counted. I created a date table and tried using DAX to do this, but has no luck so far. I would really appreciate your help on this! Thanks!

 

IWallis_0-1673038640671.pngIWallis_1-1673038655563.png

 

IWallis_2-1673038719982.png

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @IWallis ,

 

Supposing you have a following calendar table and sample main data.

vstephenmsft_0-1673244435604.png

vstephenmsft_1-1673244442940.png

You don't have to create any relationship between two tables.

vstephenmsft_2-1673244469904.png

Create a measure for counting. This measure calculates the number of AccountID whose membership is still active during the current week.

Count = CALCULATE(COUNT('Table'[AccountID]),FILTER(ALLSELECTED('Table'),[Last_membership_end_date]>=MAX('Calendar'[Date])))

vstephenmsft_3-1673244570656.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @IWallis ,

 

Supposing you have a following calendar table and sample main data.

vstephenmsft_0-1673244435604.png

vstephenmsft_1-1673244442940.png

You don't have to create any relationship between two tables.

vstephenmsft_2-1673244469904.png

Create a measure for counting. This measure calculates the number of AccountID whose membership is still active during the current week.

Count = CALCULATE(COUNT('Table'[AccountID]),FILTER(ALLSELECTED('Table'),[Last_membership_end_date]>=MAX('Calendar'[Date])))

vstephenmsft_3-1673244570656.png

 

 

 

Best Regards,

Stephen Tao

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Ashish_Mathur
Super User
Super User

Hi,

If in the data, you also have a membership date, then share the download link of the PBI file.


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

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.

Top Solution Authors