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
spoten
New Member

Calculating Customer Status column and measures

I have two tables, Company_customers and Payments. I need to calculate the customers that have made payment(s) in the respective company. Discriminating users between Active and Passive users.

 

I need to calculate a column that returns if the company customer is a Paying User or a Non-Paying User, in the company_customer table. As well as the Quantity of payments the user has done, and the value.

 

Captura de tela 2022-03-03 131405.pngcompany customer.png

5 REPLIES 5
tamerj1
Super User
Super User

I guess the user ID's are unique in the Company_customers table. If so you can easily ctreate a relationship between the two tables. The is not as complicated as you might expect (hopping that date has nothing to do with your calculation). 
Use can use the following codes to create the three calculated columns in the Company_customers table

 

Paying User? =
NOT ISBLANK ( RELATEDTABLE ( Payments ) )
Number of Payments =
COUNTROWS ( RELATEDTABLE ( Payments ) )
Amount Paid =
SUMX ( RELATEDTABLE ( Payments ), Payments[Valor] + Payments[Valor_Cash] )

 

 

 

 

Hi tamerj1, actually I need to know if and when a user has made a payment in a respective company.

I believe the first step is to add a "User status" column in the Company_customer table.

 

For example:

01/01/2001 - User1 entered Company1 customer base -> user status = "Passive Customer"

03/01/2001 - User1 made a payment for Company1 -> user status = "Paying Customer"

03/01/2001 - User1 entered Company2 customer base -> user status = "Passive Customer"

 

From there, we could calculate the measures for Paying Customers and Non-Paying Customers easily.

@spoten 
Noted
Can you please send the same screenshot data in excel or just paste it in a reply?

amitchandak
Super User
Super User

I had a look at the links you sent. But I could not serve myself with a solution, based on that. Also, I could not figure out the [Sales], in your mentioned post, if it is a Value ($) field, or a Quantity field, as you do not show a print screen of Sales tables.

Can you custom the calculated measures or columns for my specific situation?

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.