cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
New Member

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
Super User II
Super User II

Hi @bailo 

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
Super User II
Super User II

Hi @bailo 

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

merci beaucoup

je ne saurais comment vous remercier.

Vous etes genial!!

Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors