Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

Replicate Excel logic in DAX

Hi,   I would like to replicate in Power BI, preferabily using DAX, the below excel logic: 1) Combining all the rows of a week (Monday-Sunday). The process in excel currently is the following: the...
  • v-lionel-msft's avatar
    6 years ago

    Hi Anonymous ,

     

    Column = 
    VAR x = 
    CALCULATE(
        MAX(Sheet1[record]),
        FILTER(
            Sheet1,
            Sheet1[Week] = EARLIER(Sheet1[Week]) + 1  && Sheet1[WeekDay] = "Monday"
        )
    )
    RETURN
    IF(
        Sheet1[record] <> x && Sheet1[WeekDay] <> "Monday",
        "Outflow", BLANK()
    )

     

    Best regards,
    Lionel Chen

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