Forum Discussion

sebastianqc's avatar
sebastianqc
Icon for Helper I rankHelper I
6 years ago
Solved

Repeat values from a Thursday to a Wednesday

Hello everyone ,  i have the next question: how can I repeat this data per week from Thursday to Wednesday? below I put a picture of what I have the red box data is repeated until Wednesday ...
  • Vvelarde's avatar
    Vvelarde
    6 years ago

    sebastianqc 

     

    In DAX you can try with this:

     

    1. a New Column to obtain if the day of week is Wednesday get Value1 Column:

     

     

    Value1onWed =
    IF ( WEEKDAY('Table'[Date];2) = 4; 'Table'[Value1] )

     

    2. New Column for the Corrected Values (Repeat for each column)

     

    Value1RV =
    VAR _Date = 'Table'[Date]
    RETURN
        IF (
            'Table'[Value1onWed] <> BLANK ();
            'Table'[Value1onWed];
            CALCULATE (
                LASTNONBLANK ( 'Table'[Value1]; 'Table'[Value1] );
                FILTER ( 'Table'; 'Table'[Date] < _Date )
            )
        )

     

     

    Regards

     

    Victor