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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

fill blanks with prior values - weekends and holidays

Please, I need help.

My raw data contains business days with a single value.
But I need to repeat the latest valid value into weekends and holidays.

Below, Z is what I have, ZZ is what I need. See that the latest value from Friday is copied into Saturday and Sunday.
If there is a holiday midweek, it also needs to copy the latest value.

I cannot use query editor (language M), I need to use DAX.

I am having trouble with some commands such as LASTNONBLANK, EARLIEST, EARLIER.

How should I fix this?

 

fill blanks from prior row.png

1 ACCEPTED SOLUTION
nickchobotar
Skilled Sharer
Skilled Sharer

Hello @Anonymous

 

Here is the solution as a calc colum, please let me know if this works:

 

 

ZZ = 
VAR WeekDays =
    WEEKDAY ( Table1[Date] )
VAR Logic =
    IF (
        WeekDays IN { 7, 1 },
        MAXX ( FILTER ( Table1, Table1[Date] < EARLIER ( Table1[Date] ) ), Table1[Z] )
    )
RETURN
    IF ( WEEKDAY ( Table1[Date] ) IN { 7, 1 }, Logic, Table1[Z] )

image.png

 

View solution in original post

17 REPLIES 17

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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