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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Custom Column - Count of products per client over time

Hi,

 

I have several calculations that I want to perform. My data looks like this at the moment:

 

Current dataCurrent data

The first thing that I want is to create a Custom Column using Edit Queries. I want a Product count per product (Products being Cant_TC / Cant_CC / Cant_CA). Afterwards, I would like a measure that gives me the average product count per client. I did it this way in Excel:

Desired measuresDesired measures

In the end, the goal is to get something like this:

GoalGoal

It is important to know that this calculations will change over time so it must include some kind of client and time measure (FechaCarga and Client).

 

 

Thanks in advance,

 

IC

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,
 
There are 3 measures you need:
 
Product Qty = SUM(Sheet1[Cant_CA]) + SUM(Sheet1[Cant_CC]) + SUM(Sheet1[Cant_TC])
 
Product count = COUNT(Sheet1[Cant_CA]) +COUNT(Sheet1[Cant_CC]) + COUNT(Sheet1[Cant_TC])
 
Average Products = AVERAGEX(Sheet1, [Product count])
 
I also upload the test file I made, download it and you can run it on your computer:
 
Please mark my reply as a solution if it works. Thank you!

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

Hi @Anonymous ,
 
There are 3 measures you need:
 
Product Qty = SUM(Sheet1[Cant_CA]) + SUM(Sheet1[Cant_CC]) + SUM(Sheet1[Cant_TC])
 
Product count = COUNT(Sheet1[Cant_CA]) +COUNT(Sheet1[Cant_CC]) + COUNT(Sheet1[Cant_TC])
 
Average Products = AVERAGEX(Sheet1, [Product count])
 
I also upload the test file I made, download it and you can run it on your computer:
 
Please mark my reply as a solution if it works. Thank you!
Anonymous
Not applicable

Hi @Anonymous ,

 

I had something similar: 

Average products = 

 

VAR productos_total =
COUNT('Clientes Mac'[Cant_CA]) +
COUNT('Clientes Mac'[Cant_CC]) +
COUNT('Clientes Mac'[Cant_TC]) +
COUNT('Clientes Mac'[Cant_CD]) +
COUNT('Clientes Mac'[Cant_NE]) +
COUNT('Clientes Mac'[Cant_PR_Vh]) +
COUNT('Clientes Mac'[Cant_PR_Com]) +
COUNT('Clientes Mac'[Cant_PR_Hip]) +
COUNT('Clientes Mac'[Cant_PR_Tie]) +
COUNT('Clientes Mac'[Cant_PR_Per]) +
COUNT('Clientes Mac'[Cant_PR_LC])
 
return
AVERAGEX('Clientes Mac'[Productos_total])
 
and it didnt work. Now I tried using two separate measures and it worked. I dont understand why but thanks.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors