Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
5 years ago
Solved

Calculated Column to check date cycle

Hi Folks,   I have two tables Events and Events_Cycle. The events table has a column Date of Event. The events_Cycle table has 3 columns Cycle_name, cycle start date, and cycle end date. I want ...
  • Fowmy's avatar
    5 years ago

    Anonymous 

    Add the following Code as  a New Column to your Events Table:

    Cycle = 
    VAR __DATE = Events[Event Date]
    VAR __CYCLE = 
    
    MAXX(
        FILTER(
            'Events Cycle',
        __DATE >= 'Events Cycle'[Cycle Start] && __DATE <= 'Events Cycle'[Cycle End]
        ),
        'Events Cycle'[Cycle]
    )
    RETURN
    
    IF( ISBLANK(__CYCLE), "No Cycle", __CYCLE )

    ________________________

    If my answer was helpful, please consider Accept it as the solution to help the other members find it

    Click on the Thumbs-Up icon if you like this reply 🙂

    YouTube  LinkedIn