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

We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now

Reply
Marvhall
Helper I
Helper I

Need help calculating for a matrix

Good afternoon,

 

I am looking to update a calculated column with different values (New user based on ID, Existing user (based on ID)), number users ended service (date column), and the number of users re-enrolled (date column).

Currently I have this calculated column formula:

 

Customer Profile = 

var CustomerID = 'table'[ID]

var MonthIndex = 'table'[Month Index]

var PreviousCount = Calculate(Countrows('table'), FILTER(ALL('table'), 'table'[ID]' = CustomerID && 'table[month Index] < Monthndex ) )

 

Return

 

IF( PreviousCount > 0, "Previous Customer,", "New Customer")

 

I can't figure out how to add the other measures to this profile. If I put them in separately, they don't show up as rows or they show up as a hierarchy to New and Previous customers.

 

Thanks in Advance!

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@Marvhall , refer if my logic os using isblank with previous period can help

 

Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retenti...

 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

View solution in original post

2 REPLIES 2
amitchandak
Super User
Super User

@Marvhall , refer if my logic os using isblank with previous period can help

 

Customer Retention Part 1:
https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-1-Month-on-Month-Retention/b...
Customer Retention Part 2: Period over Period Retention :https://community.powerbi.com/t5/Community-Blog/Customer-Retention-Part-2-Period-over-Period-Retenti...

 

 

If this does not help
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thank you, I took some of your logic and made it into this:

I created an index column because the customer ID is repetative monthly:

Index = RANKX (FILTER ( 'Table 1', EARLIER('Table 1'[Customer_ID]) = 'Table 1'[Customer_ID]), 'CTable 1'[YearMonth], , ASC)

 

Then based the profile off the index numbers.

 

_Customer Profile =
varCustomerID = 'Table 1'[Customer_ID]
var MonthIndex = 'Table 1'[_Month Index]
var previousCount = CALCULATE(COUNTROWS('Table 1'), FILTER(ALL('Customer_ID'),'Table 1'[Customer_ID] = CustomerID && 'Table 1'[_Month Index]))
RETURN

IF( NOT ISBLANK('Table 1'[Customer_End_Date]), "Customer Quit",
IF( 'table 1'[Index] = 1, "New Customer",
IF('Table 1'[Index] =2, "Previous Customer", "Same Customer")
             )
       )
)

Helpful resources

Announcements
New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.