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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

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
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.