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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
jay_patel
Helper IV
Helper IV

How to Get Categorical Data for Maximum Date to neglect Duplicacy.

Hello All,

I am facing an issue while trying to calculate sales by category for updated date.Here i have data which is mentioned below

Date CategorySales
21-04-2021A1250
22-04-2021A2200
23-04-2021A3100
24-04-2021A1300
25-04-2021A4200
25-04-2021A5200

 

But the issue I am getting while displaying Sales for every Category but for Updated date, its taking sum of repeated Category for every date as mentioned below:-

A1550
A2200
A3100
A4200
A5200

 

Here it's taking sum of A1 for each date or both date i.e. (21-04-2021 & 24-04-2021). But it should take value only for Updated date i.e 24-04-2021 and the data should be like

A1300
A2200
A3100
A4200
A5200

 

 

Thanks in advance.  

1 REPLY 1
jdbuchanan71
Super User
Super User

@jay_patel 

Give this a try.

 

Last Amount =
SUMX (
    VALUES ( 'Table'[Category] ),
    CALCULATE ( SUM ( 'Table'[Sales] ), LASTDATE ( 'Table'[Date] ) )
)

 

jdbuchanan71_0-1649252260828.png

 

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 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.

Top Solution Authors
Top Kudoed Authors