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
limpfisch
New Member

DAX to return sum of most recent values by ID

Hi there

 

I have a table set up like this

 

limpfisch_0-1699755528904.png

 

 

I wish to create a table visual which takes the sum of the most recent values for each ID for every rounded date time. So the desired output would look like this

 

limpfisch_1-1699755608568.png

 

 

I am using direct query mode.

 

Any help is much appreciated.

 

Thanks

2 REPLIES 2
Jihwan_Kim
Super User
Super User

Hi,

I assume the table name is "Data".

Please try the below DAX measure if it suits your requirement.

 

Expected result dax measure: =
SUMX (
    WINDOW (
        -1,
        ABS,
        -1,
        ABS,
        SUMMARIZE ( Data, Data[ID], Data[DateTime], Data[Value] ),
        ORDERBY ( Data[DateTime], ASC ),
        ,
        PARTITIONBY ( Data[ID] )
    ),
    Data[Value]
)

 

Jihwan_Kim_0-1699768066181.png

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Ahmedx
Super User
Super User

Based on your description, I created data to reproduce your scenario. The pbix file is attached in the end.

Screenshot_2.png

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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