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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
Super User
Super User

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors