cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
ONBjoaoribeiro
Regular Visitor

Add Number of Sales to Customer Summary Table

Good afternoon,

 

I am trying to count the number of times a Customer has been serviced during a specific year, but somehow I cannot find the solution. I really hope you can help me out.

 

This is the info I have in Power BI Desktop Tables

Table One: Contains all the business data (Columns are: Customer Name, Year Service Provided, Amount Billed)

Table Two: Contains the list of alll customers and its type  (Columns are: Customer Name, Customer Type)

 

I want to add to Table Two a column that counts the times the Customer has been serviced during 2021. (This data is available in table one).

 

I know this must be easy to accomplish and I looked everywhere for an answer, but I just can't find it. 

 

Thank you very much in advance,

 

Joao

1 ACCEPTED SOLUTION
v-jayw-msft
Community Support
Community Support

Hi @ONBjoaoribeiro ,

 

Check the formula.

Column = CALCULATE(COUNT('Table'[Customer]),FILTER('Table','Table'[year]=2020&&'Table'[Customer]='Table (2)'[Customer]))

4.PNG

5.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

View solution in original post

4 REPLIES 4
v-jayw-msft
Community Support
Community Support

Hi @ONBjoaoribeiro ,

 

Check the formula.

Column = CALCULATE(COUNT('Table'[Customer]),FILTER('Table','Table'[year]=2020&&'Table'[Customer]='Table (2)'[Customer]))

4.PNG

5.PNG

 

Best Regards,

Jay

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.

Thanks a lot Jay.

 

This worked perfectly. 

ONBjoaoribeiro
Regular Visitor

Hello @Krutigawale33 ,

 

The column count of customer name, you have  on your example, is exactly what I am trying to achieve. I need it as a calculated column on my table. See examples below:

 

I need the column 2020 Rango Embarques to be automatically updated, by looking up the value in column Customer+Country on the table Actual Shipments. The column should count how many rows the lookedup value appears if Ano (Year) = 2020

 

Screenshot 2021-03-15 113257.pngScreenshot 2021-03-15 113410.png

Krutigawale33
Responsive Resident
Responsive Resident

Hello @ONBjoaoribeiro ,

 

I have tried to create what you want by adding some dummy data.

 

Krutigawale33_0-1615720314430.png

let me know if this is what you want. if not then could you able to provide some data to analyze the problem

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Top Solution Authors