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
JEM_Systems
Helper I
Helper I

bring the SUM of Amount for the last value based on date and document number

Hi, I have some document number transaction that sometimes can bring the same value but in multiple dates, so I need to bring just the value for the last date the most recent, but I need to sum the most recent value for each document number, could someone help me?

JEM_Systems_0-1687544362925.png

 

2 REPLIES 2
Ashish_Mathur
Super User
Super User

Hi,

Create a Date column by using the following calculated column formula

Date= 1*("1/"&Data[Month]&"/"&Data[Year])

Create a Calendar Table with a relationship (Many to One and Single) from the Date column created above to the Date column of the Calendar Table.  To the Table visual, drag Document number column.  Write these measures

Amt = sum(Data[Amount])

Measure = CALCULATE([Amt],LASTNONBLANK('Calendar'[Date],CALCULATE([amt])))


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Ahmedx
Super User
Super User

Share some data to work with (in a format the can be pasted in an MS Excel file) and show the expected result.

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.