Forum Discussion

unnijoy's avatar
unnijoy
Icon for Post Prodigy rankPost Prodigy
6 years ago
Solved

Quarter based on predefined date Range

I have a quarter referrence table for Quarter. In my main table (table 1) i have to get the quarter next to the date column.    For example, table 1 date is 20-3-2019 then quarter should get Qtr 1...
  • Anonymous's avatar
    Anonymous
    6 years ago

    unnijoy ,

     

    See if this work.

     

    1. Table 1

     

    2. Table 2

     

     

    3. Create a Calculated Column

     

     

    StartDatefromTable1 = CALCULATE (
    SELECTEDVALUE ( Table1[Start Date], 0 ),
    FILTER (
    ALLNOBLANKROW ( Table1[Start Date] ),
    Table1[Start Date] < Table2[Date]
    ),
    FILTER (
    ALLNOBLANKROW ( Table1[End Date]),
    Table1[End Date] > Table2[Date]
    ),
    REMOVEFILTERS ( )
    )
     
    4. Link the relationship of Table1 and Table 2 between Columns StartDatefromTable1 (Table2)  and StartDate (Table1)
     
    5. Create a calculated Column.
    QuarterfromTable1 = RELATED(Table1[Quarter])
     
     
     
    Regards,
    Harsh Nathani
     
    Did I answer your question? Mark my post as a solution! Appreciate with a Kudos!!