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.
Hi all,
I have a table with for each year a student start at the university a row appears. I want to find out how long it takes before the student is graduating. But there are some difficulities. A lot of them are already tackled, but there are still some exceptions which are not covered yet. For instance a student can have a second diploma in the same education, but I want to calculate the duration based on the first diploma.
This is part of my table:
Studentnumber Education StartDate Enddate Diploma
00001 X 15/09/2016 15/06/2017
00001 X 15/09/2017 15/06/2018
00001 X 15/09/2018 15/06/2019 Yes
00001 X 15/09/2019 15/06/2020 Yes
Solved! Go to Solution.
Hi @JoSwinnen1 ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _start=
MINX(FILTER(ALL('Table'),
'Table'[Studentumnber]=MAX('Table'[Studentumnber])),[StartDate])
var _end=
MINX(FILTER(ALL('Table'),
'Table'[Studentumnber]=MAX('Table'[Studentumnber])&&'Table'[Diploma]="Yes"),[EndDate])
return
DATEDIFF(_start,_end,DAY)
2. Result:
If you need pbix, please click here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
Hi @JoSwinnen1 ,
Here are the steps you can follow:
1. Create measure.
Measure =
var _start=
MINX(FILTER(ALL('Table'),
'Table'[Studentumnber]=MAX('Table'[Studentumnber])),[StartDate])
var _end=
MINX(FILTER(ALL('Table'),
'Table'[Studentumnber]=MAX('Table'[Studentumnber])&&'Table'[Diploma]="Yes"),[EndDate])
return
DATEDIFF(_start,_end,DAY)
2. Result:
If you need pbix, please click here.
Best Regards,
Liu Yang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly
@JoSwinnen1 , Create measure like
Sumx(Summarize(Filter( vw_PowerBI, vw_PowerBI[Diploma]="Yes"), vw_powerBI,vw_powerBI[studentnumber], vw_powerBI[education] , "_1", datediff(min(vw_powerBI[startdate]),max(vw_powerBI[enddate]),DAY)/365 ), [_1])
Thank you for your reply. I don't understand the formula. Can you explain? Because it seems that it is not giving the appropriate result.
Maybe another difficulty: I want to create classes also (<2 years, 2-4 years, ...), is it not better to create a calculated column then?
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
41 | |
21 | |
21 | |
14 | |
13 |
User | Count |
---|---|
42 | |
33 | |
30 | |
18 | |
18 |