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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
PaulusB
Frequent Visitor

Missing dates in table, how to always show the latest known value?

I am building a dashboard to show a stock porfolio. In het stock rates table I do not have rates for every day. Whatever date you choose in the slicer, the stock rate should be the latest available one in the stock rate table. By example at 31-12-2020 you will get the latest rates of 04-02-2020.

How do I get this measure or table?

 

ISIN-codeStock NameStock rateDate
US5949181045Microsoft102,8008-01-2019
US0846707026Berkshire Hathaway196,3108-01-2019
US5949181045Microsoft180,1204-02-2020
US0846707026Berkshire Hathaway225,0804-02-2020
US0846707026Berkshire Hathaway292,524-6-2021
US5949181045Microsoft216,51

13-11-2020

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi @PaulusB ,

 

You need to make use of the LASTNONBLANK something similar to this:

 

Measure = LASTNONBLANK('Table'[Stock rate], MAX('Table'[Date]))

 

MFelix_0-1631556980563.pngMFelix_1-1631556998260.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

2 REPLIES 2
MFelix
Super User
Super User

Hi @PaulusB ,

 

You need to make use of the LASTNONBLANK something similar to this:

 

Measure = LASTNONBLANK('Table'[Stock rate], MAX('Table'[Date]))

 

MFelix_0-1631556980563.pngMFelix_1-1631556998260.png

 


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Thanks Miguel, you directed me to the wright way to solve this problem!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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