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

Data Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more

Reply
davehus
Memorable Member
Memorable Member

Count for Each function?

Hi,

 

Our company sells products a different prices dependant on the sector we trade in. How do I count the number of price points for each product we sell?

 

Thanks 🙂

1 ACCEPTED SOLUTION
v-sihou-msft
Microsoft Employee
Microsoft Employee

@davehus

 

Based on your description, you want to count number of prices group on Product level. Right?

 

In this scenario, you can use ALLEXCEPT() in to calculation to ignore all other filter but Prodct.

 

Count Of Prices per Product = CALCULATE(DISTINCTCOUNT('Product'[Price]),ALLEXCEPT('Product','Product'[Product]))

 

 

Regards,

View solution in original post

2 REPLIES 2
v-sihou-msft
Microsoft Employee
Microsoft Employee

@davehus

 

Based on your description, you want to count number of prices group on Product level. Right?

 

In this scenario, you can use ALLEXCEPT() in to calculation to ignore all other filter but Prodct.

 

Count Of Prices per Product = CALCULATE(DISTINCTCOUNT('Product'[Price]),ALLEXCEPT('Product','Product'[Product]))

 

 

Regards,

hohlick
Continued Contributor
Continued Contributor

Suppose there is 'Prices' table (Product-Sector-Price) and 'Products' table (other Products info).

They should be linked 1 to many (Products-Prices)

 

Calculated column in 'Products' table:

Number of different prices per product = CALCULATE(DISTINCTCOUNT('Prices'[Price]))

 

If you need a measure which will count number of different prices per selected product (or group of products), the formula is the same

Maxim Zelensky
excel-inside.pro

Helpful resources

Announcements
Fabric Data Days is here Carousel

Fabric Data Days 2026

Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.

May Power BI Update Carousel

Power BI Monthly Update - May 2026

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

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.