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

measure to sum values in a column, filtering only for the most recent period

Hi Guys,

 

Can anybody point me in the right direction with this please?

 

I need to create a measure which sums up the values in a column, but only looks at the most recent period per plant (ignoring all the previous preiods). I've highlighted in the picture below which rows it should sum up.

 

PhoenixBird_1-1600341563982.png

So rather than adding up the values for every sinlge month per location (making the total 190), it should just look at the most recent month, so it'd calculate 13+14+2 =29.

 

Any ideas?

 

 

 

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

You can create a measure as below:

Measure =
VAR _tab =
    SUMMARIZE (
        'Table',
        'Table'[Plant],
        "maxperiod", MAX ( 'Table'[Period] ),
        "mjFinding", MAX ( 'Table'[No of Major Findings] )
    )
RETURN
    SUMX ( _tab, [mjFinding] )

Best Regards

Rena

View solution in original post

3 REPLIES 3
FrankAT
Community Champion
Community Champion

Hi @Anonymous 

take a look at the following solution:

 

21-09-_2020_11-28-53.png

Sum of No of Major Findings = SUM('Table'[No of Major Findings])

Sum of No of Minor Findings = SUM('Table'[No of Minor Findings])


Recent No of Major Findings = 
CALCULATE(
    [Sum of No of Major Findings],
    FILTER(
        ALLEXCEPT('Table','Table'[Plant]), 
        MAX('Table'[Periad]) = 'Table'[Periad]
    )
)


Recent No of Minor Findings = 
CALCULATE(
    [Sum of No of Minor Findings],
    FILTER(
        ALLEXCEPT('Table','Table'[Plant]), 
        MAX('Table'[Period]) = 'Table'[Period]
    )
)

 

With kind regards from the town where the legend of the 'Pied Piper of Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Anonymous
Not applicable

Hi @Anonymous ,

You can create a measure as below:

Measure =
VAR _tab =
    SUMMARIZE (
        'Table',
        'Table'[Plant],
        "maxperiod", MAX ( 'Table'[Period] ),
        "mjFinding", MAX ( 'Table'[No of Major Findings] )
    )
RETURN
    SUMX ( _tab, [mjFinding] )

Best Regards

Rena

amitchandak
Super User
Super User

@Anonymous , You can do it like

But you need a sortable month like YYYYMM Format

 

calculate( [no of maajor finidng], filter( Table,[Month Year Sort] = max(Month Year Sort])), allexcept(Table, Table[Plant]))

 

calculate(sum(Table [no of maajor finidng]), filter( Table,[Month Year Sort] = max(Month Year Sort])), allexcept(Table, Table[Plant]))

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.