Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I'm using educational data. Did not quite found a similar example, so here's what I'm struggling to achieve. First, some context. I have 3 tables: calendar, semesters and students. Semesters cannot be included in dates because it generates conflicts. Students complete an admission form prior to the semester, so semesters encompasses 2 date ranges: admission and registration.
The calendar is linked to students' dates, semesters are linked to students' semesters.
My goal is to calculate a semester-to-date and compare it to the same previous semester (automn 2023 to autumn 2022, noted 20233 and 20223 respectively.
I use this to calculate the current or selected semester:
Solved! Go to Solution.
@jsbourni , If can create year and semester no in your date table and table
Like Summer =1, automn 2
The create a key = [Year] &"-"& [semester no]
Create a new table Period(if you do not have date table) with distinct [Year],[semester no], [Key]
Join both tables on key /date
and new column Date or Period table
Period Rank = RANKX((Period),Period[Key],,ASC,Dense)
This Period = CALCULATE(countrows(Table) , FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])))
Last Period = CALCULATE(countrows(Table) , FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])-1))
Last Period same period= CALCULATE(countrows(Table) , FILTER(ALL(Period),Period[Year]=max(Period[Year])-1 && Period[Period]=max(Period[Period])))
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
@jsbourni , If can create year and semester no in your date table and table
Like Summer =1, automn 2
The create a key = [Year] &"-"& [semester no]
Create a new table Period(if you do not have date table) with distinct [Year],[semester no], [Key]
Join both tables on key /date
and new column Date or Period table
Period Rank = RANKX((Period),Period[Key],,ASC,Dense)
This Period = CALCULATE(countrows(Table) , FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])))
Last Period = CALCULATE(countrows(Table) , FILTER(ALL(Period),Period[Period Rank]=max(Period[Period Rank])-1))
Last Period same period= CALCULATE(countrows(Table) , FILTER(ALL(Period),Period[Year]=max(Period[Year])-1 && Period[Period]=max(Period[Period])))
Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s
hi,
Thank you for your answer. I have some tweaking to do, but I think it's a good solution.
best,
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
72 | |
67 | |
51 | |
38 | |
26 |
User | Count |
---|---|
89 | |
52 | |
45 | |
39 | |
38 |