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

Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.

Reply
Anonymous
Not applicable

calculate value (through measure and calculated column) of one period earlier without a date table

Hi,

I would like to calculate the value of a period earlier but without using a seperate date table.

Instead of a date column, I created a seperate column with a lists quarters (called 'datesortnumber') but they are mentioned as 1, 2, 3, 4, 5, 6 etc.

I would like to display the value whereby the datesort period is one earlier.

This I would like to achieve with a measures as well as through a calculated column.

A very simplified version of my input table:

VALUE, DATESORTNUMBER
111, 1
112, 2
113, 3
114, 4
115, 5

The result should look like:
DATESORTNUMBER, RESULTVALUE
1, no result (because no value at datesortnumber 0)
2, 111
3, 112
4, 113
5, 114

How can I achieve to create this result value column whereby the value is one datesort earlier (through a measure and a calculated column?  Thank you for the help!

1 ACCEPTED SOLUTION
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try:

Measure =
  VAR __DateSortNum = MAX('Table'[DATESORTNUMBER])
RETURN
  MAXX(FILTER(ALL('Table'),[DATESORTNUMBER] = __DateSortNum - 1),[VALUE])


Column = 
  VAR __DateSortNum = 'Table'[DATESORTNUMBER]
RETURN
  MAXX(FILTER(ALL('Table'),[DATESORTNUMBER] = __DateSortNum - 1),[VALUE])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...

View solution in original post

2 REPLIES 2
Greg_Deckler
Community Champion
Community Champion

@Anonymous Try:

Measure =
  VAR __DateSortNum = MAX('Table'[DATESORTNUMBER])
RETURN
  MAXX(FILTER(ALL('Table'),[DATESORTNUMBER] = __DateSortNum - 1),[VALUE])


Column = 
  VAR __DateSortNum = 'Table'[DATESORTNUMBER]
RETURN
  MAXX(FILTER(ALL('Table'),[DATESORTNUMBER] = __DateSortNum - 1),[VALUE])


Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
DAX For Humans

DAX is easy, CALCULATE makes DAX hard...
Anonymous
Not applicable

Works perfect, thank you!

Helpful resources

Announcements
FabCon Global Hackathon Carousel

FabCon Global Hackathon

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!

September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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.

Top Solution Authors
Top Kudoed Authors