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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.