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
ALambert
Frequent Visitor

Splitting stats table based on columns from another table

I have Table A that is a list of memberships and relevant info

constituent_idmembership_idduesprogramcategorysubcategoryjoinedexpiresstandingdate_added
1879571101950DfPDA. Community Member $50 09/15/2110/04/23Active10/04/22
184600992150DfPDA. Community Member $50 04/28/2110/03/23Active10/04/22
158578940245DfPDB. Individual Professional Member $45.00 08/21/2010/03/23Active10/03/22
185639999750DfPDA. Community Member $50 08/10/2110/03/23Active10/03/22
18913711748100DfPDC. Individual Professional Member $100.00 10/03/2210/03/23Active10/03/22
180325944345DfPDB. Individual Professional Member $45.00 08/31/2009/29/23Active09/29/22
1891321174750DfPDA. Community Member $50 09/29/2209/29/23Active09/29/22
1705811542150MMDG04. Collaborating Friend 04/25/2207/19/23Active07/19/22
177236116573000MMDG08. Collaborating Partner 07/07/2207/07/23Active07/07/22
17871211655150MMDG04. Collaborating Friend 07/06/2207/06/23Active07/06/22
456011165460MMDG03. Sponsoring Friend 07/06/2207/06/23Active07/06/22
52219864040th AnniversarySeason Pass 03/30/21 Dropped11/05/21
1099849654000040th AnniversarySeason Sponsor 11/19/1511/19/16Lapsed05/25/21
15105990416040th AnniversarySeason Pass 04/20/2104/20/22Lapsed

04/20/21

 

and Table B that is a date table with some statistics about membership activity for a given day

DateYearMonthDayActive MembersTotal Members
08/06/2220228610884860
08/07/2220228710834860
08/08/2220228810834860
08/09/2220228910864863
08/10/22202281010854863
08/11/22202281110824863
08/12/22202281210814863
08/13/22202281310804863
08/14/22202281410804863
08/15/22202281510804863
08/16/22202281610804863

the stats are calculated from Table A using

 

 

Active Members = COUNTROWS(FILTER('Constituent membership', AND('Date Stats'[Date] >= 'Constituent membership'[joined], 'Date Stats'[Date] <= 'Constituent membership'[expires])))

 

 

and

 

 

Total Members = COUNTROWS(FILTER('Constituent membership', 'Constituent membership'[joined] <= 'Date Stats'[Date]))

 

 

 

The issue I'm having is that if I create chart that uses stats from Table B, but then try to split it using the membership program as a legend, I just get 2 identical lines (the correct data is not identical)

activeMembersToDate.PNG

 

Is there someway for me to create a relationship between these two tables so that I can get a line for each membership program without having to create a new measure for each program?

Any advice on what to lookup here or how to go about this is greatly appreciated. Not even sure what to google.

1 ACCEPTED SOLUTION
ImkeF
Super User
Super User

Hi @ALambert ,
this looks like a typical "Events in progress"-pattern to me. You need either just one appropriate measure or a different helper table. Please check out this article: Events in progress – DAX Patterns and let me know if you have trouble implementing it to your case.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

View solution in original post

1 REPLY 1
ImkeF
Super User
Super User

Hi @ALambert ,
this looks like a typical "Events in progress"-pattern to me. You need either just one appropriate measure or a different helper table. Please check out this article: Events in progress – DAX Patterns and let me know if you have trouble implementing it to your case.

Imke Feldmann (The BIccountant)

If you liked my solution, please give it a thumbs up. And if I did answer your question, please mark this post as a solution. Thanks!

How to integrate M-code into your solution -- How to get your questions answered quickly -- How to provide sample data -- Check out more PBI- learning resources here -- Performance Tipps for M-queries

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.