cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
jessicaloureiro
Frequent Visitor

Frequency

Hello, can anybody help me? I dont even know where to start 😞

 

Situation:

thats not the real table because i cant share the information, but is something like this:

 

CostumerProductDate
Costumer 1   Product x   01/10/2021
Costumer 2   Product x01/10/2021
Costumer 1Product x  01/10/2021
Costumer 1Product x  01/09/2021
Costumer 1Product x  01/08/2021
Costumer 2Product x  10/10/2021
Costumer 3Product x  05/09/2021
Costumer 3Product x  10/08/2021
Costumer 3Product x  07/07/2021
Costumer 3Product x  01/11/2021

 

and the output would be: 

When i select a month the card visualization will show how many costumers purchased at 3 differents months in the last 5 months (if i select july for example it will be the 5 months before july)

 

For example (for this data table): 

If i select november, the measure will return 2 costumers, because between november and june 2 costumers purchased in 3 differents months. 

 

Thank you very much!!

 

PS: sorry for my english, i'm brazilian

1 ACCEPTED SOLUTION
v-xiaotang
Community Support
Community Support

Hi @jessicaloureiro 

try this measure,

Measure = 
    var _date=DATE(MAX('Calendar'[Date].[Year]),MAX('Calendar'[Date].[MonthNo]),1)
    var _start=EOMONTH(_date,-5)
    var _end=EOMONTH(_date,0)
return IF(ISFILTERED('Calendar'[Date].[Month]),CALCULATE(DISTINCTCOUNT('Table'[Costumer]),FILTER(ALL('Table'),'Table'[Date]<=_end&&'Table'[Date]>_start)),BLANK())

result

vxiaotang_0-1638518131719.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

2 REPLIES 2
v-xiaotang
Community Support
Community Support

Hi @jessicaloureiro 

try this measure,

Measure = 
    var _date=DATE(MAX('Calendar'[Date].[Year]),MAX('Calendar'[Date].[MonthNo]),1)
    var _start=EOMONTH(_date,-5)
    var _end=EOMONTH(_date,0)
return IF(ISFILTERED('Calendar'[Date].[Month]),CALCULATE(DISTINCTCOUNT('Table'[Costumer]),FILTER(ALL('Table'),'Table'[Date]<=_end&&'Table'[Date]>_start)),BLANK())

result

vxiaotang_0-1638518131719.png

Best Regards,

Community Support Team _Tang

If this post helps, please consider Accept it as the solution to help the other members find it more quickly.

amitchandak
Super User
Super User

@jessicaloureiro , Use date tbale, join with date. Add month year column in table

 

New column

Month year = format([Date], "YYYYMM")

 

Measures
Rolling 5= CALCULATE(DistinctCount('Table'[Month Year]),DATESINPERIOD('Date'[Date ],MAX('Date'[Date ]),-5,MONTH))

Min 3 Months = countx(filter(values(Table[Customer]), [Rolling 5] >=3), [Customer])

Did I answer your question? Mark my post as a solution! Appreciate your Kudos!! !!
Dashboard of My Blogs !! Connect on Linkedin
Want To Learn Power BI
Learn Power BI Beginners !! Advance Power BI Concepts !! Power BI For Tableau User !! Learn Power BI in Hindi !!
Proud to be a Super User!
!! Subscribe to my youtube Channel !!

Helpful resources

Announcements
Microsoft Build 768x460.png

Microsoft Build is May 24-26. Have you registered yet?

Come together to explore latest innovations in code and application development—and gain insights from experts from around the world.

charticulator_carousel_with_text (1).png

Charticulator Design Challenge

Put your data visualization and design skills to the test! This exciting challenge is happening now through May 31st!

May UG Leader Call Carousel 768x460.png

What difference can a User Group make for you?

At the monthly call, connect with other leaders and find out how community makes your experience even better.

Power BI Dev Camp Session 22 768x460.jpg

Check it out!

Mark your calendars and join us on Thursday, May 26 at 11a PDT for a great session with Ted Pattison!