Forum Discussion

MarioA's avatar
MarioA
New Member
3 years ago
Solved

Simple Like for like analysis

Hello Guys,   I am faced with a classic like for like problem.    I have a set of stores data, and would like to create a column where I can flag which store is "like for like", which one has bee...
  • mangaus1111's avatar
    3 years ago

    Hi MarioA ,

    try this calculated column

    Column = 
    VAR MaxYear = MAX('Facts9'[Year])
    RETURN
    SWITCH(TRUE(),
           COUNTROWS(
                   FILTER(
                       'Facts9',
                       'Facts9'[StoreID] = EARLIER('Facts9'[StoreID])
                   )) > 1, "Like for like",
           'Facts9'[Year] = MaxYear,"Open",
           'Facts9'[Year] < MaxYear,"Close"      
    )

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