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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

Reply
felipescamilo
New Member

How do I calculate how many different products a store has sold in a month?

Hi! I'm having trouble calculating how many different products a store has bought in a month. I'm currently using the following formula as in an example for august:

CALCULATE(
(DISTINCTCOUNT(Product[Product Code),
FILTER([Product], [#Sales]>0),
Date[Month/Year]="aug/2022")

 
It returns me how many different products the store has sold, but it is not considering in august. The number is always the same for every month i pick.

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @felipescamilo 

please try

=
COUNTROWS (
CALCULATETABLE (
VALUES ( 'Product'[Product Code] ),
CROSSFILTER ( 'Product'[Product Code], 'Sales'[Product Code], BOTH )
)
)

View solution in original post

1 REPLY 1
tamerj1
Super User
Super User

Hi @felipescamilo 

please try

=
COUNTROWS (
CALCULATETABLE (
VALUES ( 'Product'[Product Code] ),
CROSSFILTER ( 'Product'[Product Code], 'Sales'[Product Code], BOTH )
)
)

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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