Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
asn4293
New Member

Event calendar: Next event and previous event

I am stuck in building the event calendar but in concise view. It should show me by stakeholder what was the last event and what will be the next event for the respective stakeholder. Below you will find the solution how it should look like. 

Stakeholder groupCurrent Engagement levelLast EventLast Event DateNext Event Next Event date
A1Board Meeting20.11.2022Board brainstorming01.01.2023
B1Leadership meeting19.11.2022Leadership comms02.01.2023
C2Offsite hangout20.10.2022On site discussion03.01.2023
D2Strategic communication15.11.2022Global comms 15.01.2023

 

 

And the data looks like this 

EventStakeholder GroupStart DateEnd Date
Board MeetingA21. Okt 2221. Okt 22
Board talksA04. Okt 2210. Nov 22
Board MeetingA20. Nov 2220. Nov 22
Board brainstormingA01. Jan 2301. Jan 23
Board MeetingA04. Jan 2304. Jan 23
Leadership MeetingB19. Nov 2219. Nov 22
Leadership talksB10. Nov 2215. Nov 22
Leadership commsB02.01.202302.01.2023

 

So in theory what I need a formula which can give 

1) Next event definition:
Where End date is greater than today and minimum of End date date based on stakeholder

2) Last event definition:
Where End date is less than today and maximum of end date based on stakeholder 




 

1 ACCEPTED SOLUTION
v-rzhou-msft
Community Support
Community Support

Hi @asn4293 ,

 

Here I create a sample to have a test.

Data model:

RicoZhou_0-1669193660014.png

Last Event = 
CALCULATE(MAX('Table'[Event]),FILTER('Table','Table'[End Date] = [Last Event Date]))
Last Event Date =
CALCULATE (
    MAX ( 'Table'[End Date] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Stakeholder Group] = MAX ( 'Table (2)'[Stakeholder group] )
            && 'Table'[End Date] <= TODAY ()
    )
)
Next Event = 
CALCULATE(MAX('Table'[Event]),FILTER('Table','Table'[End Date] = [Next Event Date]))
Next Event Date =
CALCULATE (
    MIN ( 'Table'[End Date] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Stakeholder Group] = MAX ( 'Table (2)'[Stakeholder group] )
            && 'Table'[End Date] > TODAY ()
    )
)

Result is as below.

RicoZhou_1-1669193772736.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

3 REPLIES 3
asn4293
New Member

@v-rzhou-msft  Thank you so much 

v-rzhou-msft
Community Support
Community Support

Hi @asn4293 ,

 

Here I create a sample to have a test.

Data model:

RicoZhou_0-1669193660014.png

Last Event = 
CALCULATE(MAX('Table'[Event]),FILTER('Table','Table'[End Date] = [Last Event Date]))
Last Event Date =
CALCULATE (
    MAX ( 'Table'[End Date] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Stakeholder Group] = MAX ( 'Table (2)'[Stakeholder group] )
            && 'Table'[End Date] <= TODAY ()
    )
)
Next Event = 
CALCULATE(MAX('Table'[Event]),FILTER('Table','Table'[End Date] = [Next Event Date]))
Next Event Date =
CALCULATE (
    MIN ( 'Table'[End Date] ),
    FILTER (
        ALL ( 'Table' ),
        'Table'[Stakeholder Group] = MAX ( 'Table (2)'[Stakeholder group] )
            && 'Table'[End Date] > TODAY ()
    )
)

Result is as below.

RicoZhou_1-1669193772736.png

 

Best Regards,
Rico Zhou

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

asn4293
New Member

Hi @amitchandak would you be able to help me here I saw some solutions of yours but it does not work here

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.