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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
JBG
Regular Visitor

highest value by category

 
 
Hello everyone!! I am trying to extract the data from the latest date record (ex: for each customer last delivery date & delivered quantitiy) I am able to select the last date but I get the sum of all deliveries. Do you know how I could have only the delivered quantity from the last delivery? Thank you very much!
1 ACCEPTED SOLUTION

Hi there

 

This is possibly what you are after?

 

Measure = 
CALCULATE (
    SUM ( 'Table1'[StorageLevelAfterDelivery(kg)] ),
    FILTER ( 'Table1', 'Table1'[ShiftEndDate] = MAX ( 'Table1'[ShiftEndDate] ) )
)

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

View solution in original post

7 REPLIES 7
GilbertQ
Super User
Super User

Hi there,

Could you please post some sample data and the expected outcome so that we can look at how to solve your current challenge?




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hello Gilbert,

 

Here is an example of what I would like to do :

SiteNameShiftCodeShiftEndDateStorageLevelAfterDelivery(kg)
A2320/07/201833 600
A2615/12/201734 300
A3008/03/201834 300
A5205/04/201834 300
A3730/01/201835 000
A12316/02/201835 000
B4515/12/201716 800
B8907/08/201832 900
B9515/03/201833 250
B7521/03/201833 250
B7827/02/201833 600
B6229/03/201833 600
C5415/12/201734 300
C6808/03/201834 300
C14505/04/201834 300
C9630/01/201835 000
C10216/02/201835 000
    
SiteNameShiftCodeLatestShiftEndDateStorageLevelAfterDelivery(kg)
A2320/07/201833 600
B8907/08/201832 900
C14505/04/201834 300

Thanks by advance

Hi JBG,

 

Create a measure using DAX as below:

LatestShiftEndDate = CALCULATE(MAX(Table1[ShiftEndDate]), ALLEXCEPT(Table1, Table1[SiteName]))

Capture.PNG  

 

Regards,

Jimmy Tao

Hi Jimmy,

 

Thanks for your answer. Unfortunatley, I still have the same problem which is it doesn't filter one data (the latest) per site name. When I wwant to know quantities per site at the latest date, I still have several datas per site... If you have another advice... Thanks

Hi there

 

This is possibly what you are after?

 

Measure = 
CALCULATE (
    SUM ( 'Table1'[StorageLevelAfterDelivery(kg)] ),
    FILTER ( 'Table1', 'Table1'[ShiftEndDate] = MAX ( 'Table1'[ShiftEndDate] ) )
)

image.png





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Hello everyone,

 

Thanks for your help. After I tried each of your solutions, it worked with the first one and then I filter the table with maxdate = 1.

 

Thanks a lot.

 

See you

 

Jerome

Glad you got it working




Did I answer your question? Mark my post as a solution!

Proud to be a Super User!







Power BI Blog

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

Find out what's new and trending in the Fabric Community.

Top Solution Authors
Top Kudoed Authors