Age in Years/Months

duesouth

New Member
Joined
Jan 30, 2024
Messages
5
Office Version
  1. 365
Platform
  1. Windows
I work in a school. On our management information (SIMS), pupils have a recorded reading age. This is stored in SIMS as 13/4, 11/10 etc. which represents Year / Month (e.g. 13 years, 4 months; 11 years, 10 months).

I've been trying to get this reading age into Power BI (or Excel first) in a format where I can then have an average in Power BI to which staff can then apply various slicers (year group, free school meals etc. etc.), but have been striking out. I've managed to get a figure in Power BI for an individual in the 13 years, 4 months format - but when I put a card visual onto the page the only options I have are first, last, count and count distinct, so Power BI isn't storing this as a time period, but a text field - so I can't average.

(The formula I used (after converting years and months into months) is:

Reading Age =
var year1= INT('Reading Ages'[RA in Months]/12)
var month1='Reading Ages'[RA in Months]- year1*12
return
SWITCH( TRUE(),
'Reading Ages'[RA in Months]<12,"0 Year "& 'Reading Ages'[RA in Months] & " Months",
'Reading Ages'[RA in Months]=12,"1 Year "& "0 Months",
year1& " Years " & month1 & " Months")

Is there a way to get this into a format from where I can average pupil's reading ages? Perhaps do this in Excel first and then have Power Query recognise the format as a duration?

Many thanks in advance for any help.
 

Excel Facts

Links? Where??
If Excel says you have links but you can't find them, go to Formulas, Name Manager. Look for old links to dead workbooks & delete.
Figured it out! Put age in months into Power BI - then did an AVERAGE of the reading age and then applied the formula above to the average measure.
 
Upvote 0

Forum statistics

Threads
1,221,418
Messages
6,159,791
Members
451,589
Latest member
Harold14

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top