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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. 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
v-stephen-msft
Community Support
Community Support

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
v-stephen-msft
Community Support
Community Support

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
Sept PBI Carousel

Power BI Monthly Update - September 2024

Check out the September 2024 Power BI update to learn about new features.

September Hackathon Carousel

Microsoft Fabric & AI Learning Hackathon

Learn from experts, get hands-on experience, and win awesome prizes.

Sept NL Carousel

Fabric Community Update - September 2024

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

Top Solution Authors