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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Fusilier
Helper III
Helper III

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.

54a370bc-d6d5-463e-bc2e-da7bb0513450.jpg

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 1
FreemanZ
Super User
Super User

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]
)

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.