cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
rfernandes Regular Visitor
Regular Visitor

How to find categoric variable by max/min date

Hello everyone, 

 

I want to create a table that summarize my database, i need to show the first day that a client made a purchase and where it was.

 

To find the first buy date, i used Min o date column. But i dont know how to make the "First Buy Store" . It is possible to groupby by first categoric value by the date or something like that?

 

NameDate First BuyFirst Buy Store
Johny1/1/2018C
Lucas3/14/2018B
Brian2/2/2018A

 

This is the sample database:

 

NameDateStoreValue
Johny6/1/2018A12
Johny5/13/2018B10
Johny11/28/2018A85
Johny1/1/2018C34
Johny2/15/2018B56
Lucas11/25/2018B75
Lucas3/14/2018B35
Lucas9/18/2018C45
Lucas7/3/2018C56
Brian2/2/2018A84
Brian3/18/2018A68
Brian10/1/2018C11
Brian9/18/2018B12

 

 

Thanks

1 ACCEPTED SOLUTION

Accepted Solutions
affan Established Member
Established Member

Re: How to find categoric variable by max/min date

Hi @rfernandes

 

You can use the below measure to find the first sotre from where thr customer has purchased.

 

 

First store = var _firstdate=MIN(Table1[Date]) 
Return
CALCULATE(
    FIRSTNONBLANK(Table1[Store],
        1),
            FILTER(Table1,_firstdate))

 

I got below result from this measureFirstStore.pngFirst Store

 You can see the pbix file here.

 

 

 

If this helped you, please mark this post as an accepted solution and like to give KUDOS .

 

Regards,

Affan

2 REPLIES 2
affan Established Member
Established Member

Re: How to find categoric variable by max/min date

Hi @rfernandes

 

You can use the below measure to find the first sotre from where thr customer has purchased.

 

 

First store = var _firstdate=MIN(Table1[Date]) 
Return
CALCULATE(
    FIRSTNONBLANK(Table1[Store],
        1),
            FILTER(Table1,_firstdate))

 

I got below result from this measureFirstStore.pngFirst Store

 You can see the pbix file here.

 

 

 

If this helped you, please mark this post as an accepted solution and like to give KUDOS .

 

Regards,

Affan

Highlighted
rfernandes Regular Visitor
Regular Visitor

Re: How to find categoric variable by max/min date

Thank you!! 

Helpful resources

Announcements
Community Kudopalooza

Win Power BI Swag with Community Kudopalooza!

Each week, complete activities and be qualified in the drawing for cool Power BI Swag.

Summit North America

Power Platform Summit North America

Register by September 5 to save $200

Virtual Launch Event

Microsoft Business Applications Virtual Launch Event

Watch the event on demand for an in-depth look at the new innovations across Dynamics 365 and the Microsoft Power Platform.

MBAS Gallery

Watch Sessions On Demand!

Continue your learning in our online communities.

Users Online
Currently online: 300 members 2,762 guests
Please welcome our newest community members: