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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

Reply
Tarek78210
Frequent Visitor

First creation date per customer

Hi All,

 

I have one simple table with two columns:

 

- one column for the customergroup name

-one column showing when that customer group was created

 

A customer group can have multiple customers. That's the reason why we have multiple creation dates per customer group. I would like to create a dax that shows the first date of creation per customer group.

 

Example: CustomerGroup1 has 3 dates but the first one was created the 1/01/2021 and therefore, I want to see that date shown up in a new column.

 

Thanks very much for your help!

 

first date.PNG

4 REPLIES 4
Tarek78210
Frequent Visitor

Thanks very much. Is it a column measure or DAX measure? Ideally, I would like a measure I can create as a new column

Hi,

The suggestion that I provided was a calculated column, not a measure.

For creating a measure, please check the below.

 

Jihwan_Kim_0-1709060296677.png

First Date measure =
CALCULATE (
    MIN ( Data[CreationDate] ),
    INDEX (
        1,
        SUMMARIZE ( Data, Data[CustomerGroup], Data[CreationDate] ),
        ORDERBY ( Data[CreationDate], ASC )
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Jihwan_Kim
Super User
Super User

Hi,

Please check the below picture and the attached pbix file.

It is for creating a new column.

 

Jihwan_Kim_0-1709056566285.png

 

 

INDEX function (DAX) - DAX | Microsoft Learn

 

First Date CC =
SELECTCOLUMNS (
    INDEX (
        1,
        SUMMARIZE ( Data, Data[CustomerGroup], Data[CreationDate] ),
        ORDERBY ( Data[CreationDate], ASC ),
        ,
        PARTITIONBY ( Data[CustomerGroup] ),
        MATCHBY ( Data[CustomerGroup], Data[CreationDate] )
    ),
    Data[CreationDate]
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Visit my LinkedIn page by clicking here.


Schedule a meeting with me to discuss further by clicking here.

Thanks. For your information, I am on Power Pivot, not Power BI. For some reasons, all the formulas don't appear in the predictive text. For example: Selectedcolumns appear but not the Index function.

 

Is your formula working with the Power Pivot environment?

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

November Carousel

Fabric Community Update - November 2024

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

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.