Forum Discussion

ucfaramos's avatar
ucfaramos
New Member
1 year ago
Solved

How to Enable Time Intelligence for Academic Semesters Without Date Columns

I'm working in Power BI Desktop and need help building a semester-based academic calendar for use with time intelligence functions—particularly year-over-year comparisons across terms. The challenge is that our dataset lacks standard date or time columns, which makes using Power BI’s built-in time intelligence features difficult.

These are the available fields in the dataset:

  • ACAD_YEAR (e.g., 2015-16)
  • ACAD_YEAR4 (e.g., 2015-2016)
  • TERM_DESC (e.g., Fall 2020)
  • BOE_TERM_ID (e.g., 201505)
  • STRM

I'd like to manually create time intelligence measures similar to the quick measures available for standard dates (like Year-over-Year change), but tailored to work with academic semesters.

Is it possible to simulate date-based time intelligence using these fields? If so, what would be the best modeling approach or workaround to achieve this?

Any insights or direction would be greatly appreciated!

  • Hi ucfaramos 

     

     You should create a custom academic date table with all of the info you have listed, add start date and end date columns. Also, add an index column and any other useful columns you may need

     

     

    Relate this to your fact table by BOE_TERM_ID

     

    Since built-in time intelligence functions require a true date column, you’ll need to use Term_Index instead. Use measures like this

     

    Enrollment YoY = 
    VAR CurrentTerm = SELECTEDVALUE('Academic Calendar'[Term_Index])
    VAR PreviousTerm = CurrentTerm - 2  -- Assuming 2 terms per year
    RETURN
        CALCULATE(
            [Total Enrollment],
            'Academic Calendar'[Term_Index] = PreviousTerm
        )

     

    This should work, please give a thumbs up and mark as solved if it helps, thanks!

     

  • Hi ucfaramos ,

     

    Yes, it's absolutely possible to simulate date-based time intelligence for academic semesters in Power BI without traditional date columns. The solution involves creating a dedicated "Academic Calendar" table to establish a chronological structure and then writing custom DAX measures to perform year-over-year comparisons.

    First, you need to create a new calculated table that contains a unique list of your academic terms. In the Data view of Power BI, select New Table and use the following DAX expression, replacing YourDataTable with the name of your table. This will form the foundation of your custom calendar.

    Academic Calendar =
    SUMMARIZE (
        YourDataTable,
        YourDataTable[ACAD_YEAR],
        YourDataTable[TERM_DESC],
        YourDataTable[BOE_TERM_ID]
    )

    Next, you'll enrich this new Academic Calendar table with calculated columns to enable sorting and relationships. You'll create a numeric Year Start column from ACAD_YEAR, a Term Order column to numerically represent Fall, Spring, and Summer, and finally, an Academic Year-Term Sort column that combines the year and term order for proper chronological sorting across all years.

    Year Start = VALUE(LEFT('Academic Calendar'[ACAD_YEAR], 4))
    Term Order =
    SWITCH (
        TRUE (),
        CONTAINSSTRING ( 'Academic Calendar'[TERM_DESC], "Fall" ), 1,
        CONTAINSSTRING ( 'Academic Calendar'[TERM_DESC], "Spring" ), 2,
        CONTAINSSTRING ( 'Academic Calendar'[TERM_DESC], "Summer" ), 3,
        4
    )
    Academic Year-Term Sort = 'Academic Calendar'[Year Start] * 10 + 'Academic Calendar'[Term Order]

    With the calendar table complete, go to the Model view and create a relationship by dragging BOE_TERM_ID from your new Academic Calendar table to the corresponding column in your main data table. To ensure visuals always display terms in the correct order, select the TERM_DESC column in the Data view and use the Sort by column feature to sort it by your Academic Year-Term Sort column.

    Finally, you can write DAX measures that leverage this new structure. To compare a value with the same semester in the previous academic year, you can create a measure like this, making sure to insert your base measure (e.g., SUM(YourDataTable[Enrollment])).

    Value Last Year =
    CALCULATE (
        [Your Base Measure],
        FILTER (
            ALL ( 'Academic Calendar' ),
            'Academic Calendar'[Year Start] = MAX ( 'Academic Calendar'[Year Start] ) - 1 &&
            'Academic Calendar'[Term Order] = MAX ( 'Academic Calendar'[Term Order] )
        )
    )

    From there, calculating the Year-over-Year change and percentage change is straightforward.

    YoY Change = [Your Base Measure] - [Value Last Year]
    YoY % Change = DIVIDE ( [YoY Change], [Value Last Year] )

     

    Best regards,

6 Replies

  • Hey, ucfaramos ,

    create Calendar first, and map it with your data, and the use custom expression or access one of your columns to determine the end string fro the year and write this:

    YTD test = TOTALYTD( SUM(Table[something]), 'calendar'[Date], "6/30")

    this means end of year is 30th of June.

    Then calculate the measure one year back with parralelperiod like:

    CALCULATE(
    [measureYTD],
    PARALLELPERIOD(calendar[Date], -1, YEAR)
    )

     

  • Hi ucfaramos 

     

     You should create a custom academic date table with all of the info you have listed, add start date and end date columns. Also, add an index column and any other useful columns you may need

     

     

    Relate this to your fact table by BOE_TERM_ID

     

    Since built-in time intelligence functions require a true date column, you’ll need to use Term_Index instead. Use measures like this

     

    Enrollment YoY = 
    VAR CurrentTerm = SELECTEDVALUE('Academic Calendar'[Term_Index])
    VAR PreviousTerm = CurrentTerm - 2  -- Assuming 2 terms per year
    RETURN
        CALCULATE(
            [Total Enrollment],
            'Academic Calendar'[Term_Index] = PreviousTerm
        )

     

    This should work, please give a thumbs up and mark as solved if it helps, thanks!

     

  • Hi ucfaramos ,

     

    Yes, it's absolutely possible to simulate date-based time intelligence for academic semesters in Power BI without traditional date columns. The solution involves creating a dedicated "Academic Calendar" table to establish a chronological structure and then writing custom DAX measures to perform year-over-year comparisons.

    First, you need to create a new calculated table that contains a unique list of your academic terms. In the Data view of Power BI, select New Table and use the following DAX expression, replacing YourDataTable with the name of your table. This will form the foundation of your custom calendar.

    Academic Calendar =
    SUMMARIZE (
        YourDataTable,
        YourDataTable[ACAD_YEAR],
        YourDataTable[TERM_DESC],
        YourDataTable[BOE_TERM_ID]
    )

    Next, you'll enrich this new Academic Calendar table with calculated columns to enable sorting and relationships. You'll create a numeric Year Start column from ACAD_YEAR, a Term Order column to numerically represent Fall, Spring, and Summer, and finally, an Academic Year-Term Sort column that combines the year and term order for proper chronological sorting across all years.

    Year Start = VALUE(LEFT('Academic Calendar'[ACAD_YEAR], 4))
    Term Order =
    SWITCH (
        TRUE (),
        CONTAINSSTRING ( 'Academic Calendar'[TERM_DESC], "Fall" ), 1,
        CONTAINSSTRING ( 'Academic Calendar'[TERM_DESC], "Spring" ), 2,
        CONTAINSSTRING ( 'Academic Calendar'[TERM_DESC], "Summer" ), 3,
        4
    )
    Academic Year-Term Sort = 'Academic Calendar'[Year Start] * 10 + 'Academic Calendar'[Term Order]

    With the calendar table complete, go to the Model view and create a relationship by dragging BOE_TERM_ID from your new Academic Calendar table to the corresponding column in your main data table. To ensure visuals always display terms in the correct order, select the TERM_DESC column in the Data view and use the Sort by column feature to sort it by your Academic Year-Term Sort column.

    Finally, you can write DAX measures that leverage this new structure. To compare a value with the same semester in the previous academic year, you can create a measure like this, making sure to insert your base measure (e.g., SUM(YourDataTable[Enrollment])).

    Value Last Year =
    CALCULATE (
        [Your Base Measure],
        FILTER (
            ALL ( 'Academic Calendar' ),
            'Academic Calendar'[Year Start] = MAX ( 'Academic Calendar'[Year Start] ) - 1 &&
            'Academic Calendar'[Term Order] = MAX ( 'Academic Calendar'[Term Order] )
        )
    )

    From there, calculating the Year-over-Year change and percentage change is straightforward.

    YoY Change = [Your Base Measure] - [Value Last Year]
    YoY % Change = DIVIDE ( [YoY Change], [Value Last Year] )

     

    Best regards,

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi ucfaramos ,

    Thank you DataNinja777 , wardy912 , vojtechsima  for your inputs.
    We would like to confirm if you've successfully resolved this issue or if you need further help. If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.

    Thank you for your patience and look forward to hearing from you.
    Best Regards,
    Chaithra E.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi ucfaramos ,

    We’d like to confirm whether your issue has been successfully resolved. If you still have any questions or need further assistance, please don’t hesitate to reach out. We’re more than happy to continue supporting you.

    Best Regards,
    Chaithra E.

  • v-echaithra's avatar
    v-echaithra
    Community Support

    Hi ucfaramos ,

    Just checking in to confirm that your issue has been resolved. If you have any remaining questions or need additional assistance, feel free to reach out, we're always here to help.

    Best Regards,
    Chaithra E.