Forum Discussion

Fusilier's avatar
Fusilier
Icon for Helper III rankHelper III
3 years ago

Help with creating a custom column

Trying to get to grips with DAX creating a custom column. I want to create a custom column 'LY' that shows the value 12 months previously before the current date in mt 'Location Data' table.

For example, I want to create a column 'LY' that shows the value for 01-Feb-2022 (3) next to the value for 01-Feb-2023 (1) and so on. I'm sure this is easy, but I can't get my head around it!

1 Reply

  • hi Fusilier 

    try to add a calculated column like:

    LY =
    MAXX(
        FILTER(
           data,      data[category]=EARLIER(data[category])&&data[subcategory]=EARLIER(data[subcategory])&&data[month]=EDATE(EARLIER(data[month]), -12)
        ),
        data[Value]
    )