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
uc
Helper II
Helper II

To find out school year

Hello

In UK, children start school in September after their 4th birthday. In a given cohort I need to filter only reception age group. For e.g. children starting in Sep 2021, will have their DOB between 01/09/ 2016 to 31/08/2017

 

I am able to filter the cohort using excel as shown in the attached snapshot. I am interested in only Year 0 (Reception) cohort. However, when I tried to upload the data and tried to calcualte the school year in Power BI I get different result which isn't correct. Attached Power BI snapshot too. Can you please advise where I could have got it wrong?  Thanks in advance.

 

Excel snapshot.PNGPower BI snapshot.PNG

 

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

Here is a modified DAX that should work:

Year = IF(ISBLANK([DOB]),BLANK(),"Year "&
IF(MONTH(DOB[DOB])<9,DATEDIFF(DOB[DOB],TODAY(),YEAR)-4,
DATEDIFF(DOB[DOB],TODAY(),YEAR)-5))
End result:
ValtteriN_0-1641687848096.png

So in this example the only child starting this year would be the one born in 1.1.2018. This checks out since during this year's September they have turned four.

Regarding your original formula. It is not usually a good idea to use days in formulas (like with 122) so I used different method in my example. 

I hope this helps to solve your issue and if it does consider accepting this as a solution and giving the post a thumbs up!

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
ValtteriN
Super User
Super User

Hi,

Here is a modified DAX that should work:

Year = IF(ISBLANK([DOB]),BLANK(),"Year "&
IF(MONTH(DOB[DOB])<9,DATEDIFF(DOB[DOB],TODAY(),YEAR)-4,
DATEDIFF(DOB[DOB],TODAY(),YEAR)-5))
End result:
ValtteriN_0-1641687848096.png

So in this example the only child starting this year would be the one born in 1.1.2018. This checks out since during this year's September they have turned four.

Regarding your original formula. It is not usually a good idea to use days in formulas (like with 122) so I used different method in my example. 

I hope this helps to solve your issue and if it does consider accepting this as a solution and giving the post a thumbs up!

 




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Thankyou. It works.

Hi,

Could you mark my post as a solution? That helps other to find the answer easier in the future.





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




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.