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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.