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
jfpalumbo123
Frequent Visitor

Last Sale Date and Amount per Product with Total

Data sample is:

 

Product    Date          Amount

1               01/02       $100

1               02/15       $200

2               02/15       $300

2               03/31       $400

 

I am trying to get:

1 - Last Date and Amount per Product

2 - Total Amount of all items in #1

 

Desired output is:

Product    Date          Amount

1               02/15       $200

2               03/31       $400

                   Total:      $600

 

I can get #1 via many methods, but my Total row is always only showing the Amount of the last Date over all the data (or other issues) but not the desired output. ie: Total row only shows 03/31 value of $400, but I cannot get it to include the Product 1 02/15 Amount of $200 so that my total is $600 as desired.

 

 

 

1 ACCEPTED SOLUTION
ValtteriN
Super User
Super User

Hi,

Here is one way to do this with a filter measure:

data:

ValtteriN_0-1671315064135.png

dax:

Filter last date for product =
var _ldate = CALCULATE(MAX('Table (15)'[Date]),ALL('Table (15)'[Date])) return
IF(MAX('Table (15)'[Date])=_ldate,1,0)


Now place the measure to your visual:
ValtteriN_1-1671315196388.png

Measure 25 is just a sum measure for getting the total. For total amount of items you can use count.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





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

Proud to be a Super User!




View solution in original post

2 REPLIES 2
ValtteriN
Super User
Super User

Hi,

Here is one way to do this with a filter measure:

data:

ValtteriN_0-1671315064135.png

dax:

Filter last date for product =
var _ldate = CALCULATE(MAX('Table (15)'[Date]),ALL('Table (15)'[Date])) return
IF(MAX('Table (15)'[Date])=_ldate,1,0)


Now place the measure to your visual:
ValtteriN_1-1671315196388.png

Measure 25 is just a sum measure for getting the total. For total amount of items you can use count.

I hope this post helps to solve your issue and if it does consider accepting it as a solution and giving the post a thumbs up!

My LinkedIn: https://www.linkedin.com/in/n%C3%A4ttiahov-00001/





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

Proud to be a Super User!




That worked perfectly. I sure did over-engineer it 😞 

 

Thank you!

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.

Top Solution Authors