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
bml123
Post Patron
Post Patron

Monday that comes after last friday of the previous month

HI,

 

I want to get monday that comes after last friday of the previous month in the calendar table.  How do I get that?

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

Hi, @bml123 

Try this:

Result =
CALCULATE(
    MAX( 'Table'[Date] ),
    FILTER(
        ALL( 'Table' ),
        'Table'[Date] <= EOMONTH( MAX( 'Table'[Date] ), -1 )
            && 'Table'[Date] > EOMONTH( MAX( 'Table'[Date] ), -2 )
            && WEEKDAY( [Date], 2 ) = 5
    )
) + 3

Result:

vangzhengmsft_0-1645423952361.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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
v-angzheng-msft
Community Support
Community Support

Hi, @bml123 

Try this:

Result =
CALCULATE(
    MAX( 'Table'[Date] ),
    FILTER(
        ALL( 'Table' ),
        'Table'[Date] <= EOMONTH( MAX( 'Table'[Date] ), -1 )
            && 'Table'[Date] > EOMONTH( MAX( 'Table'[Date] ), -2 )
            && WEEKDAY( [Date], 2 ) = 5
    )
) + 3

Result:

vangzhengmsft_0-1645423952361.png

Please refer to the attachment below for details.

Hope this helps.

 

 

Best Regards,
Community Support Team _ Zeon Zheng


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

serpiva64
Super User
Super User

Hi,

i think you are not sorting correctly. As text monday cames after friday. You need to sort Day Name for Numeric values of Day in Week.

Hi @serpiva64 

 

It's not about sorting.  For every date in the calendar table, I need to add a column to get monday that comes after last friday of the previous month in the calendar table.  How do I achieve that?

Helpful resources

Announcements
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.