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
mlovejoy
Helper I
Helper I

Summarize and Filter to keep only the first time a customer came to our school

Hello community,

 

I m trying to create a table or a column to retrieve unique Student ID and their respective date of the first time they came in our school from the enrollment table.

 

What I've tried so far:

 

Screenshot 2022-11-28 at 10.15.13.png

 

So Student ID musst be unique and the date should be the first time he came to our school. So Minimum start date by Student ID.

 

Any help? Should be simple but can't do it 🙂

 

Thanks for you help

 

3 ACCEPTED SOLUTIONS
shreyamukkawar
Resolver II
Resolver II

Hi @mlovejoy 

Please find this below solution.

Test table = SUMMARIZE('Table','Table'[Student id],"start_date",MIN('Table'[datteofstart]))
 
shreyamukkawar_0-1669634668214.png

 

Best Regards,
Shreya Mukkawar

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

View solution in original post

@NikhilChenna @shreyamukkawar  I'm doing this in DAX and it works, except that I want to retrieve  the Intake Year of that "related Min Starting Date". Any ideas 🙂

Thanks a lot for your help.

Screenshot 2022-11-28 at 13.52.22.png

View solution in original post

NikhilChenna
Continued Contributor
Continued Contributor

Hi @mlovejoy ,

It is easy to map, but for that you have to create a unique key between 2 tables. 

1. Create a concat of studentid and date using this in both the tables, =CONCATENATE('table1'[studentID],TEXT('table1'[Date],"mmddyyyy")

 

2. Create a new column in the summarized table, using lookup function,

Calculated column = LOOKUPVALUE('table1'[Intake Year],'table1'[concat],'summarizedtable'[concat])

 

This will solve your issue.

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

View solution in original post

6 REPLIES 6
NikhilChenna
Continued Contributor
Continued Contributor

Hi @mlovejoy ,

It is easy to map, but for that you have to create a unique key between 2 tables. 

1. Create a concat of studentid and date using this in both the tables, =CONCATENATE('table1'[studentID],TEXT('table1'[Date],"mmddyyyy")

 

2. Create a new column in the summarized table, using lookup function,

Calculated column = LOOKUPVALUE('table1'[Intake Year],'table1'[concat],'summarizedtable'[concat])

 

This will solve your issue.

 

Regards,

Nikhil Chenna

 

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

NikhilChenna
Continued Contributor
Continued Contributor

Hi @mlovejoy , You can achieve this by this below solution.

1. Go the modelling tab and click on the new table option.

2. Use this below logic,

 

Summarize_table = 

SUMMARIZE(
'Enrollments',
'Enrollments'[StudentID],
"Min Intake Year",MIN('Enrollments'[Intake Year])
"Min date",MIN('Enrollments'[Date starting])
)
 
Regards,
Nikhil Chenna
 
Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

@NikhilChenna @shreyamukkawar  I'm doing this in DAX and it works, except that I want to retrieve  the Intake Year of that "related Min Starting Date". Any ideas 🙂

Thanks a lot for your help.

Screenshot 2022-11-28 at 13.52.22.png

Hello @NikhilChenna ,

 

thanks for your answer. Howerver Intake Year is a text column Q1 2022, S2 2023,... so there is no minimum. Would there be a possiblity to add a column in the Student table to get this information? Basically I want to use Min start date as a criteria to put the related Intake Year (Q2 2022, S2 2023, ...)  comming from the enrollment table in every student ID of the student table.

Screenshot 2022-11-28 at 13.37.07.png

 

Thanks

Mark

shreyamukkawar
Resolver II
Resolver II

Hi @mlovejoy 

Please find this below solution.

Test table = SUMMARIZE('Table','Table'[Student id],"start_date",MIN('Table'[datteofstart]))
 
shreyamukkawar_0-1669634668214.png

 

Best Regards,
Shreya Mukkawar

Appreciate with a Kudos!! (Click the Thumbs Up Button)
Did I answer your question? Mark my post as a solution!

Hello @shreyamukkawar ,

thanks for your answer. For every Student ID I need to get the Intake Year which is text (Q2 2022, S1 2023,..). So actually the Date Min date start is the criteria to filter adn get the Intake Date.

 

Regards

 

Mark

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