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
cdawidow
Helper III
Helper III

Count Months where total sales were greater than 0

Hi guys, simply I just want to calculate the count of months where total sales were > 0 for a customer.  I treid this but its not getting what I need.

 

FREQUENCY = COUNTAX(VALUES('DATE'[FiscalMonth]),[TOTAL SALES]>0)
 
Any help would be appreciated
2 REPLIES 2
Anonymous
Not applicable

I don't think it's possible to create a formula with this description. What would you like the measure to return if you select from the Date table, say, just one day? Or half a month? Or, say, any period of time that is not fully comprised of months? What would you like the measure to return? There are many, many formulas that will do the same thing when you've selected well shaped periods from your calendar but which will give you different answers when you select "badly" shaped ones.

AlB
Community Champion
Community Champion

Hi @cdawidow 

Try

FREQUENCY =
COUNTROWS ( FILTER ( VALUES ( 'DATE'[FiscalMonth] ), [TOTAL SALES] > 0 ) )

or 

FREQUENCY =
SUMX ( VALUES ( 'DATE'[FiscalMonth] ), 1 * ( [TOTAL SALES] > 0 ) )

 

SU18_powerbi_badge

Please accept the solution when done and consider giving a thumbs up if posts are helpful. 

Contact me privately for support with any larger-scale BI needs, tutoring, etc.

 

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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.