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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Find the sum last 3 values in column

Hello,

I want to find sum of the 3 last values of my column "quantityItem" using 3 last dates.

on the example below : 

 

my 3 last dates are 25/02/2020; 28/01/2020; 31/12/2020

i want the sum "1 +1 +1" = 3

 

Captureaa.PNG

 

Thank's for your help

 

1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hi @Anonymous 

take a look at the following solution (I used my own sample data):

 

27-10-_2020_18-02-16.png

 

Top3 = 
SUMX(
    TOPn(
        3,
        'Table',
        'Table'[CollectionDate_c],
        DESC
    ),
    'Table'[QuantityCollectedItem_c]
)

 

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

View solution in original post

2 REPLIES 2
FrankAT
Community Champion
Community Champion

Hi @Anonymous 

take a look at the following solution (I used my own sample data):

 

27-10-_2020_18-02-16.png

 

Top3 = 
SUMX(
    TOPn(
        3,
        'Table',
        'Table'[CollectionDate_c],
        DESC
    ),
    'Table'[QuantityCollectedItem_c]
)

 

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

merci beaucoup

je ne saurais comment vous remercier.

Vous etes genial!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

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.