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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

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
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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