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

The Power BI DataViz World Championships are on! With four chances to enter, you could win a spot in the LIVE Grand Finale in Las Vegas. Show off your skills.

Reply
Marwen89
Frequent Visitor

latest value on the future

Hello,

I want to copy latest value of a mesure on the future even it s equal to 0 or null.

Exemple: copy 38068 to last date on the calendar.

tempsnip.png

 

Could you assist please with DAX formulas?

Thank you.

 

Regards,

 

 

12 REPLIES 12
Marwen89
Frequent Visitor

Any suggestions? 

Hi @Marwen89 ,

 

Try to create a measure like below:

Measure = 
VAR LastDate_ =
    CALCULATE (
        MAX ( 'Table'[Date] ),
        ALL ( 'Table' )
    )
var max_ = CALCULATE(SUM('Table'[Value]),FILTER(ALL('Table'),'Table'[Date]=LastDate_))
VAR result =
    CALCULATE (
        SUM('Table'[Value]),
        DATEADD('Calendar'[Date],1,DAY)
    )

RETURN
    if(max('Calendar'[Date])>=LastDate_,max_,Result)

Vlianlmsft_0-1649922033159.png

 


Best Regards,
Liang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Hello @V-lianl-msft ,

it does not work for future  date,

here i have last value at 04/04/2022, i want it copied for the future date.

Marwen89_0-1650017666773.png

Thanks,

@Marwen89 Hi!

 

Can you paste some sample data and explicit expcted result?

It isn't clear.

Thx,

BF.

@BeaBF  I really want to copy the latest value of "In Transit Retail TRV Picture end period (qty)" even is null for th future, Seen that  "In Transit Retail TRV Picture end period (qty)" is a measure.

A DAX formulas is needed .

Marwen89_0-1649765479272.png

Thanks,
Regards,

@Marwen89 you can do it in Power Query, thorught Table.FillDown function, like this:

 

#"NEW STEP = Table.FillDown(#"PREVIOUS STEP",{"In Transit Retail TRV Picture end period (qty)"})
in
#"NEW STEP"

 

BF

 

I want a dax formula @BeaBF 

@Marwen89  if you have a table like this:

 

BeaBF_0-1649768632682.png

 

you can create a calculated column to do so:

 

Colonna =
VAR LastNonBlankDate =
CALCULATE (
LASTNONBLANK ('Tabella (2)'[DATE], 1 ),
FILTER (
ALL ('Tabella (2)' ),
'Tabella (2)'[DATE] <= EARLIER ( 'Tabella (2)'[DATE])
&& NOT ( ISBLANK ( 'Tabella (2)'[RETAIL] ) )
)
)
RETURN
CALCULATE (
SUM ( 'Tabella (2)'[RETAIL] ),
FILTER ( ALL ( 'Tabella (2)'),'Tabella (2)'[DATE]= LastNonBlankDate )
)
 
BF.

 "In Transit Retail TRV Picture end period (qty)" is a measure,

@Marwen89 Can you paste me the code of the measure?

 

Thx

CALCULATE (SUM ( 'In Transit Retail, Supply'[TransitPictures Quantity] ), DATEADD ( LASTDATE ( 'Period'[Date] ), 1, DAY ))

 

@BeaBF 


 

@Marwen89 So try the calculated column above with Supply'[TransitPictures Quantity] .

 

BF

Helpful resources

Announcements
Feb2025 Sticker Challenge

Join our Community Sticker Challenge 2025

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

Jan NL Carousel

Fabric Community Update - January 2025

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