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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
Moha_shanti
Regular Visitor

How to get the max day within month list

Hi,

I have a tbale contains list of materials with Reservations approval dates, as shown below, I want to get MAX day in month for each material

the column MAX Day in Month In Material is the results required

ReservationMaterialReservation Approval dateMAX Day in Month In Material
607012113000501424619-May-2319-May-23
636819313000501424616-May-2319-May-23
636793013000501424616-May-2319-May-23
636811613000501424617-May-2319-May-23
636338213000501424618-May-2319-May-23
626555313000501424630-Apr-2330-Apr-23
621861413000501424628-Apr-2330-Apr-23
621995413000501424626-Apr-2330-Apr-23
620669613000501424625-Apr-2330-Apr-23
618609213000501424619-Apr-2330-Apr-23
617999213000501424618-Apr-2330-Apr-23
554277513000501424603-Jan-2303-Jan-23
555256813000501424603-Jan-2303-Jan-23
555182213000501424603-Jan-2303-Jan-23
554139413000501424602-Jan-2303-Jan-23
554330413000501424602-Jan-2303-Jan-23
554322613000501424602-Jan-2303-Jan-23
554308213000501424602-Jan-2303-Jan-23
607012113000501001019-May-2319-May-23
636819313000501001016-May-2319-May-23
636338213000501001018-May-2319-May-23
626555313000501001030-Apr-2330-Apr-23
621861413000501001028-Apr-2330-Apr-23
621995413000501001026-Apr-2330-Apr-23
620669613000501001025-Apr-2330-Apr-23
554277513000501001003-Jan-2303-Jan-23
1 ACCEPTED SOLUTION
johnt75
Super User
Super User

You could create a column like

MAX Day in Month In Material =
VAR MonthStart =
    EOMONTH ( 'Table'[Reservation approval date], -1 ) + 1
VAR MonthEnd =
    EOMONTH ( 'Table'[Reservation approval date], 0 )
VAR MaxDate =
    CALCULATE (
        MAX ( 'Table'[Reservation approval date] ),
        ALLEXCEPT ( 'Table', 'Table'[Material] ),
        DATESBETWEEN ( 'Table'[Reservation approval date], MonthStart, MonthEnd )
    )
RETURN
    MaxDate

View solution in original post

2 REPLIES 2
johnt75
Super User
Super User

You could create a column like

MAX Day in Month In Material =
VAR MonthStart =
    EOMONTH ( 'Table'[Reservation approval date], -1 ) + 1
VAR MonthEnd =
    EOMONTH ( 'Table'[Reservation approval date], 0 )
VAR MaxDate =
    CALCULATE (
        MAX ( 'Table'[Reservation approval date] ),
        ALLEXCEPT ( 'Table', 'Table'[Material] ),
        DATESBETWEEN ( 'Table'[Reservation approval date], MonthStart, MonthEnd )
    )
RETURN
    MaxDate

Perfect Mr.John, Thanks a lot

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Solution Authors
Top Kudoed Authors