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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Luiscv73
Frequent Visitor

Calculation of tenure, Member_Month and PMPM

Hello everyone in this great community, I bringing a new challenger that I have to see who can help me.

I have a Members table similar to the following sample:

Member_IDMember_NameMonthMembership_type
Mbr1Member11Gold
Mbr1Member12Gold
Mbr1Member13Gold
Mbr1Member14Gold
Mbr2Member23Gold
Mbr2Member24Gold
Mbr2Member25Gold
Mbr2Member26Gold
Mbr2Member27Gold
Mbr2Member28Gold
Mbr2Member29Gold
Mbr3Member31Silver
Mbr3Member32Silver
Mbr4Member42Silver
Mbr4Member43Silver
Mbr4Member44Silver
Mbr4Member45Silver
Mbr5Member51Bronze
Mbr5Member52Bronze
Mbr5Member53Bronze
Mbr5Member54Bronze
Mbr5Member55Bronze
Mbr5Member56Bronze

 

I need calculate Tenure by member as count of how many months each Member_ID has. Example, tenure for Mbr1 is 4, Mbr2 is 7, Mbr3 is 2, as shown below.

 

Member_IDTenure
Mbr14
Mbr27
Mbr32
Mbr44
Mbr56

 

Then I need a summary as count of Member_ID by Tenure. Example, Tenure 2 has 1 count, Tenure 4 has 2 counts, Tenure 6 has 1 count and Tenure 7 has 1 count.

Then I need Member Month as the sum of the multiplication of each Tenure by the count of Member_ID in it. Example, Sum(2x1,4x2,6x1,7x1)= 23, I need that number to calculate Per Member Per Month (PMPM) cost later.

I achieved all by a "group by" query in power query that have a colunm of tenure and another one with Member_ID count and measures in DAX, the issue is it doesn't change with a slicer to filter by Membership_type.

I have another version with a DAX summary table, columns Member_Id and Tenure, as:

Luiscv73_0-1678475980993.png

I created a relationship between this Tenure_Table and Members table by Member_Id, so now I have a visual table that changes the values for each tenure with the slicer by Membership_type. The problem here is that I don't know how to continue, to make de sum of the product Tenure x Count_by_Tenure. The sample below is the visual table that move with the slicer, the columns _Test Tenure are different formulas I used to get the count by tenure, one of them is  Count_by_Tenure = AVERAGEX( KEEPFILTERS(VALUES('Tenure_Table'[Tenure])), CALCULATE(COUNTA('Tenure_Table'[Member_ID]))

Luiscv73_1-1678476303282.png

 

I appretiate any idea, thank you in advance.

1 REPLY 1
v-jianboli-msft
Community Support
Community Support

Hi @Luiscv73 ,

 

It seems that you can achieve your goal by using the sum of Tenure directly:

vjianbolimsft_0-1678675627343.png

vjianbolimsft_1-1678675638197.png

If I misunderstand you, Please provide me with more details about your table and your problem or share me with your pbix file after removing sensitive data.

 

Refer to:

How to provide sample data in the Power BI Forum

How to Get Your Question Answered Quickly

 

Best Regards,

Jianbo Li

 

 

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

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