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

Get Fabric certified for FREE! Don't miss your chance! Learn more

Reply
Anonymous
Not applicable

Values that pertain to the most recent or last month of the quarter

Hi. I need help creating a column(Qtr_Inspections) that has values that pertain to the most recent or last month of the quarter. Basically, I just want the last value of every Quarter into this new column. 

Here's what I have:

DateQuarterInspections
1/1/2020Qtr 10
2/1/2020Qtr 12
3/1/2020Qtr 14
4/1/2020Qtr 210
5/1/2020Qtr 23
6/1/2020Qtr 27
7/1/2020Qtr 311
8/1/2020Qtr 32

 

Here's what I need:

DateQuarterInspectionsQtr_Inspections
1/1/2020Qtr 104
2/1/2020Qtr 124
3/1/2020Qtr 144
4/1/2020Qtr 2107
5/1/2020Qtr 237
6/1/2020Qtr 277
7/1/2020Qtr 3112
8/1/2020Qtr 322

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can create a measure or calculated column as below:

Measure =
VAR _maxdate =
    CALCULATE (
        MAX ( 'Inspections'[Date] ),
        ALLEXCEPT ( 'Inspections', 'Inspections'[Quarter] )
    )
RETURN
    CALCULATE (
        MAX ( 'Inspections'[Inspections] ),
        FILTER (
            ALLSELECTED ( 'Inspections' ),
            'Inspections'[Quarter] = MAX ( 'Inspections'[Quarter] )
                && 'Inspections'[Date] = _maxdate
        )
    )

Calculated column:

Qtr_Inspections = 
VAR _maxdate =
    CALCULATE (
        MAX ( 'Inspections'[Date] ),
        ALLEXCEPT ( 'Inspections', 'Inspections'[Quarter] )
    )
RETURN
    CALCULATE (
        MAX ( 'Inspections'[Inspections] ),
        FILTER (
            'Inspections',
            'Inspections'[Quarter] = EARLIER ( 'Inspections'[Quarter] )
                && 'Inspections'[Date] = _maxdate
        )
    )

Best Regards

Rena

View solution in original post

4 REPLIES 4
Anonymous
Not applicable

Hi @Anonymous ,

You can create a measure or calculated column as below:

Measure =
VAR _maxdate =
    CALCULATE (
        MAX ( 'Inspections'[Date] ),
        ALLEXCEPT ( 'Inspections', 'Inspections'[Quarter] )
    )
RETURN
    CALCULATE (
        MAX ( 'Inspections'[Inspections] ),
        FILTER (
            ALLSELECTED ( 'Inspections' ),
            'Inspections'[Quarter] = MAX ( 'Inspections'[Quarter] )
                && 'Inspections'[Date] = _maxdate
        )
    )

Calculated column:

Qtr_Inspections = 
VAR _maxdate =
    CALCULATE (
        MAX ( 'Inspections'[Date] ),
        ALLEXCEPT ( 'Inspections', 'Inspections'[Quarter] )
    )
RETURN
    CALCULATE (
        MAX ( 'Inspections'[Inspections] ),
        FILTER (
            'Inspections',
            'Inspections'[Quarter] = EARLIER ( 'Inspections'[Quarter] )
                && 'Inspections'[Date] = _maxdate
        )
    )

Best Regards

Rena

amitchandak
Super User
Super User

@Anonymous , Try like

 

calculate( Sum(Table[Inspections]), filter( Table,Table[Date] = max(Table[Date])), allexcept(Table, Table[Quarter]))

or

calculate( Sum(Table[Inspections]), filter( Table,format(Table[Date],"YYYYMM") = format(max( Table[Date]),"YYYYMM")), allexcept(Table, Table[Quarter]))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube
Anonymous
Not applicable

Thanks @amitchandak. Unfortunately, this doesn't get me what I want. Any other ideas?

@Anonymous , Please find the attached file after signature

 

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 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.