• Skip to main content
  • Skip to footer

Curbal

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

  • Data Stories
    • Power BI Stories
    • 1 dataset, 100 matplotlib visualizations
  • Learning Portal
    • Download Center
    • 25 Days Challenge
    • DAX Glossary
    • Power BI
    • Power BI by Topic
    • Python
    • 1 dataset, 100 matplotlib visualizations
  • Courses
    • Power BI Mini Master Class 1: Using a REST API as a data source
    • Power BI Master Class 1: COVID Tracker
    • Introduction to Power BI – FREE Online course
    • M Language + Power Query Course Bundle
    • Power Query Online Training [updated 2022]
    • M Language Online Course: The unofficial and Practical Reference Guide [updated 2025]
    • My Courses
  • Shop
    • Courses
    • Master Classes
    • Template Apps
    • JSON Themes
  • Cart
  • Register/ Log In
    • Become a Member
    • Log In
    • My account
    • My Courses
  • Search
  • Contact
You are here: Home / CM Tooltip Glossary Pro+ / EARLIER

EARLIER

posted on August 14, 2017

« Back to Glossary Index

Syntax

EARLIER(<column>, <number>)

Table of contents:

  1. Explain the function
  2. Calculate the difference between two dates (in same column)
  3. Calculate the sum of subcategories (or categories)

1. Explain the function

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.

DAX Fridays! #13: EARLIER

Download example file:

To get the files:
1. Go to Curbal Download Center > Dax Fridays
2. Get File #13

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.

Example 2: Calculate the difference between two dates (in same column)

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.

To get the files:
1. Go to Curbal Download Center > Dax Fridays
2. Get File #85

DAX Fridays! #85: Difference between dates in the same column

Example 3: Calculate the sum of subcategories

Let me show you how to calculate the sum of subcategories.

To get the files:
1. Go to Curbal Download Center > Dax Fridays
2. Get File #57

DAX Fridays! #57: Calculate the sum of subcategories

Example 4: Create an index based on multiple columns using DAX

Do you need to create an index based on multiple columns using DAX? Here is a detailed guide on how to do it.

DAX Fridays! #165: Create an index based on two or more columns using DAX
Was this helpful?
« Back to Index

Reader Interactions

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Footer CTA

Join our community of +50,000 professionals

Become a Member

Subscribe to YouTube

About me:

Curbal AB
Badhusgatan 7B
722 15 – Västerås
Sweden

OrgNo: 5569680852 | VAT: SE556968085201

 

Location:

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