• Skip to main content
  • Skip to footer

Curbal

Learn how to grow your business with your data and Power BI

  • Resources
    • DAX Glossary
    • Download Center
    • Template Apps
    • Data Stories Gallery
    • Solution Gallery
    • Learning Resources
  • Courses
    • Introduction to Power BI – FREE Online course
    • Power Query Online Training for Power BI
    • M Language Online Course: The unofficial and Practical Reference Guide
  • Blog
  • Shop
    • Courses
    • Swag
    • Template Apps
    • Donations
  • Cart
  • Register/ Log In
    • Become a Member
    • Log In
    • My account
    • My Courses
  • Contact
You are here: Home / CM Tooltip Glossary Pro+ / EARLIER

EARLIER

posted on August 14, 2017

« Back to Glossary Index

Syntax

EARLIER(<column>, <number>)

Tutorial with example

Learn how to use the function EARLIER in DAX/ Powerpivot.

EARLIER is mostly used in the context of calculated columns.

The performance of EARLIER might be slow because it theoretically, it might have to perform a number of operations that is close to the total number of rows (in the column) times the same number (depending on the syntax of the expression). For example if you have 10 rows in the column, approximately a 100 operations could be required; if you have 100 rows then close to 10,000 operations might be performed.

Download example file:

Download the pbix and excel file here.

Example of use of EARLIER

Do you know how to calculate the difference between dates when both are in the same column?

One example of when this is needed is when you are working with subscription based services. If you want to calculate how many dates go between users changing subscriptions, this DAX measure will help you.

Download example file:

Download the pbix and excel file here.

Remarks

EARLIER succeeds if there is a row context prior to the beginning of the table scan. Otherwise it returns an error.

The performance of EARLIER might be slow because it theoretically, it might have to perform a number of operations that is close to the total number of rows (in the column) times the same number (depending on the syntax of the expression). For example if you have 10 rows in the column, approximately a 100 operations could be required; if you have 100 rows then close to 10,000 operations might be performed.

 

Was this helpful?
[Total: 11   Average: 4.8/5]
« Back to Index

Reader Interactions

Let us know your thoughts... Cancel reply

Footer CTA

Join our community of +20,000 professionals

Become a Member

Subscribe to YouTube

About us

Curbal AB
Kopparbergsvägen, 10
722 13 – Västerås
Sweden

OrgNo: 5569680852 | VAT: SE556968085201

 

Location:

© Copyright 2014-2021 · Curbal AB · All Rights Reserved · Privacy Policy · Terms of Service · Refund Policy · Log In