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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
Denpowerbi
Regular Visitor

Help! how can I extract a value from a table for item and last movement date

Aiuto! Ciao a tutti,scusate ma non sono molto pratico e devo poter calcolare l'ultimo valore (determinato dall'ultimo dato di inserimento del movimento) per singolo articolo in una tabella dove sono presenti molti articoli.Ho provato di tutto ma senza riuscirvi Se qualcuno ha qualche suggerimento lo ringrazio in anticipo 

Denis 

3 ACCEPTED SOLUTIONS
devesh_gupta
Impactful Individual
Impactful Individual

@Denpowerbi You can try to create following measure:

 

LastValueForArticle = 
VAR MaxDate = CALCULATE(MAX('Articles'[Date]), ALLEXCEPT('Articles', 'Articles'[ArticleID]))
RETURN
CALCULATE(SUM('Articles'[Value]), 'Articles'[Date] = MaxDate)

 

This DAX measure does the following:

  • It first calculates the maximum date for each article (MaxDate) by using CALCULATE and MAX functions. The ALLEXCEPT function removes all filters except for the ArticleID.

  • Then, it uses CALCULATE again to filter the Value column to only include rows where the date matches the maximum date calculated earlier.

If you find this insightful, please provide a Kudo and accept this as a solution.

View solution in original post

Denpowerbi
Regular Visitor

Grazie!!!!!!  Mi sei stato veramente utile e gentile 

View solution in original post

@Denpowerbi Welcome! but I noticed that you marked your own thankyou comment as a solution... 

Can you please mark the actual solution as an accepted solution, it would be a great help to me and to others also.

View solution in original post

3 REPLIES 3
Denpowerbi
Regular Visitor

Grazie!!!!!!  Mi sei stato veramente utile e gentile 

@Denpowerbi Welcome! but I noticed that you marked your own thankyou comment as a solution... 

Can you please mark the actual solution as an accepted solution, it would be a great help to me and to others also.

devesh_gupta
Impactful Individual
Impactful Individual

@Denpowerbi You can try to create following measure:

 

LastValueForArticle = 
VAR MaxDate = CALCULATE(MAX('Articles'[Date]), ALLEXCEPT('Articles', 'Articles'[ArticleID]))
RETURN
CALCULATE(SUM('Articles'[Value]), 'Articles'[Date] = MaxDate)

 

This DAX measure does the following:

  • It first calculates the maximum date for each article (MaxDate) by using CALCULATE and MAX functions. The ALLEXCEPT function removes all filters except for the ArticleID.

  • Then, it uses CALCULATE again to filter the Value column to only include rows where the date matches the maximum date calculated earlier.

If you find this insightful, please provide a Kudo and accept this as a solution.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 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