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
Syndicate_Admin
Administrator
Administrator

Count months without sales with dax

Hello I have the following situation.

I want to count the months without sales to the date a seller has, from their start date.

In my calendar table I have registered the date of entry of the seller. Imagine that your income was in January 2023 and until April it has no sales.

It would take 4 months without sales.

This is what I need, obviously I have my measure of Total Sales in general.

3 REPLIES 3
Syndicate_Admin
Administrator
Administrator

Hello good day community,

I want to make a measurement with dax, which tells me the months where there were only sales, this measurement will help me to calculate the average sales in those months that there were sales, or if there was a direct way to take the average sales only from those months in which there was a sale.

Thank you.

Regards, Best regards.

Syndicate_Admin
Administrator
Administrator

Hello Friend, if it worked but tells me every month where there were no sales. The equivalent in excel would be COUNT. WHITE.

I think I did not formulate my question correctly. What I needed is to know how many months a customer has been without sales since their last sale. The answer was very simple, just use the DATEIFF function.

Thank you very much anyway.

onurbmiguel_
Super User
Super User

hello @Syndicate_Admin 

My suggestion : 

Measure = 
var _temp = 
    FILTER(
        ADDCOLUMNS(
            SUMMARIZE(
                'Calendar',
                'Calendar'[Month (Year)]
            ),
            "_total",Sales[Sales Amount]
        ),
        ISBLANK(Sales[Sales Amount])
    )
return 
COUNTROWS(_temp)

 note: you need to have a month year column in the calendar table !

 

Best regards

Bruno Costa | Impactful Individual

 

Hope this answer solves your problem!
If you need any additional help please @ me in your reply.
If my reply provided you with a solution, please consider marking it as a solution ✔️ or giving it a kudoe 👍

You can also check out BI4ALL's website and our data solutions!

 


Best regards


Bruno Costa | Super User


 


Did I help you to answer your question? Accepted my post as a solution! Appreciate your Kudos!! 


Take a look at the blog: PBI Portugal 


 


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.