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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register 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

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
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 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.