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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
ChristianDGreat
Resolver I
Resolver I

Sum only the latest date for each Type

So I have this table

TypeQtyDate
A1016-Jan
A2017-Jan
A3018-Jan
C1019-Jan
C2020-Jan
F3021-Jan
G3022-Jan

 

The result I want is to create a measure that calculate the QTY but only the latest DATE of the Type.
Example Type A should only get 30 because 1/18 is the latest date of that Type(A).

TypeMeasure
A30
C20
F30
G30
Total110
4 ACCEPTED SOLUTIONS
sayaliredij
Super User
Super User

HI @ChristianDGreat 

 

Could you please try following measure?

 

Measure = CALCULATE(SUM(Test[Qty]),FILTER(Test, Test[Date] = MAX(Test[Date])))
 

Thanks and Regards,

Sayali

Please mark the question solved when done and consider giving a thumbs up if posts are helpful!! 





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

Proud to be a Super User!




View solution in original post

Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1706333019963.png

 


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

View solution in original post

ThxAlot
Super User
Super User

Easy enough,

ThxAlot_0-1706374463570.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



View solution in original post

v-zhouwen-msft
Community Support
Community Support

Hi @ChristianDGreat ,

Please follow these steps:
1. Use the following DAX expression to create a calculated column ‘day’.

 

Day = DAY('Tabelle1'[Date])

 

vzhouwenmsft_0-1706509213553.png

vzhouwenmsft_1-1706509228401.png

2.Use the DAX expression shown to create a measure named ‘ Measure ’

Measure = 
VAR _latestDay = MAX('Tabelle1'[Day])
VAR _latestDayQty = CALCULATE(SUM(Tabelle1[Qty]),'Tabelle1'[Day] = _latestDay )
RETURN _latestDayQty

3.Use the DAX expression shown to create a measure named ‘ Measure2 ’

Measure 2 = 
SUMX(VALUES(Tabelle1[Type]),[Measure])

4. Final output

    vzhouwenmsft_0-1706509437235.png

vzhouwenmsft_1-1706509450168.png

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-zhouwen-msft
Community Support
Community Support

Hi @ChristianDGreat ,

Please follow these steps:
1. Use the following DAX expression to create a calculated column ‘day’.

 

Day = DAY('Tabelle1'[Date])

 

vzhouwenmsft_0-1706509213553.png

vzhouwenmsft_1-1706509228401.png

2.Use the DAX expression shown to create a measure named ‘ Measure ’

Measure = 
VAR _latestDay = MAX('Tabelle1'[Day])
VAR _latestDayQty = CALCULATE(SUM(Tabelle1[Qty]),'Tabelle1'[Day] = _latestDay )
RETURN _latestDayQty

3.Use the DAX expression shown to create a measure named ‘ Measure2 ’

Measure 2 = 
SUMX(VALUES(Tabelle1[Type]),[Measure])

4. Final output

    vzhouwenmsft_0-1706509437235.png

vzhouwenmsft_1-1706509450168.png

Best Regards,
Wenbin Zhou
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

ThxAlot
Super User
Super User

Easy enough,

ThxAlot_0-1706374463570.png



Expertise = List.Accumulate(


        {Days as from Today},


        {Skills and Knowledge},


        (Current, Everyday) => Current & Day.LeanAndPractise(Everyday)


)



Ashish_Mathur
Super User
Super User

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1706333019963.png

 


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

HI @ChristianDGreat 

 

Could you please try following measure?

 

Measure = CALCULATE(SUM(Test[Qty]),FILTER(Test, Test[Date] = MAX(Test[Date])))
 

Thanks and Regards,

Sayali

Please mark the question solved when done and consider giving a thumbs up if posts are helpful!! 





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

Proud to be a Super User!




Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

Jan NL Carousel

Fabric Community Update - January 2025

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