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

To celebrate FabCon Vienna, we are offering 50% off select exams. Ends October 3rd. Request your discount now.

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
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

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

Top Solution Authors
Top Kudoed Authors