Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

First Day of Semester

Hi I need assistance from you.   I have the following table. Thursday, October 1, 2020 1162.36 Friday, October 2, 2020 1165.01 Monday, October 5, 2020 1168.04 Tuesday, October 6, 2...
  • parry2k's avatar
    5 years ago

    Anonymous solution attached, the core is to store semester start date in the calendar table and then use it to get semester start value. You can tweak the logic as per your need.

     

    Check my latest blog post Year-2020, Pandemic, Power BI and Beyond to get a summary of my favourite Power BI feature releases in 2020

    I would ❤ Kudos if my solution helped. 👉 If you can spend time posting the question, you can also make efforts to give Kudos to whoever helped to solve your problem. It is a token of appreciation!

    ⚡Visit us at https://perytus.com, your one-stop-shop for Power BI-related projects/training/consultancy.⚡

     

     

  • v-xulin-mstf's avatar
    5 years ago

    Hi, Anonymous 

    I’m not sure the criteria for determining the range of semesters, what I think that the range of semesters is determined by a given table.

    The following method is what I do for you.

    If it’s not your expected output, please provide more details.

    As below:

    Step1: Create a calendar table as:

    Calendar =

    CALENDAR("2020-01-01","2020-12-31")

    Step2: Create measure as:

    FirstDay =

    CALCULATE (

        MAX ( Semesters[First Day] ),

        FILTER (

            ALL ( Semesters ),

            'Semesters'[Last Day] = SELECTEDVALUE ( 'Calendar'[Date] )

        )

    )

    Here is the output:

     

    Here is the demo, please try it: First Day of Semester

    Best Regards,

    Link