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
DaxPadawan
Helper III
Helper III

A measure for showing the latest value in a date range

In my data (which is on a daily basis), I have a field which is a cumulative sum. So when viewing the data, we care more about viewing the "current level" of the data. 

 

So for example, if I wanted to look at the data on a daily basis, I would just display the data upfront. 

 

However, if I were to look at the data on a weekly basis, then I would only want to see the level of the data on Sundays. If monthly, I would want to see the level on the last day of the month. For yearly, obviously the level at Dec 31. 

 

The best way I assume to implement this would be to have a measure that would dynamically select the latest date available in the selected data range and then return the associated value. Attached below is the kind of visualization we hope to use, so creating a measure for each date breakdown (ex. one measure for weekly, one measure for monthly) isn't really feasible. 

DaxPadawan_0-1698972947919.png

 

1 REPLY 1
amitchandak
Super User
Super User

@DaxPadawan ,

 

calculate(lastnonblankvalue(Date[Date]), [Measure])

 

refer closingbalancemonth 

Power BI closingbalancemonth closingbalancequarter closingbalanceyear, lastnonblankvalue- Closing Balance, Distibutre Target: https://youtu.be/yPQ9UV37LOU

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

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.