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
Anonymous
Not applicable

EARLIER functionality in Measure

Hi,

 

I need a Measure which contains the EARLIER functionality.

 

My Table

IDTypeFieldCustomerPicking DateBest before
1BananaAX01.01.201901.02.2019
2AppleAY01.02.201901.03.2019
3BananaBX01.03.201901.04.2019
4BananaAY01.05.201901.06.2019
5AppleBX01.03.201901.04.2019

 

To find the first Picking Date by Type a add a Column and use the Earlier function and mark it with "1".

IDTypeFieldCustomerPicking DateBest beforeColumn
1BananaAX01.01.201901.02.20191
2AppleAY01.02.201901.03.20191
3BananaBX01.03.201901.04.20190
4BananaAY01.05.201901.06.20190
5AppleBX01.03.201901.04.20190

 

But now I want to filter by Customer and find the first picking dates (depending on the type)

 

IDTypeFieldCustomerPicking DateBest beforeMeasure?
1BananaAX01.01.201901.02.20191
3BananaBX01.03.201901.04.20190
5AppleBX01.03.201901.04.20191

 

So I can't use the column. So I think I need a Measure right? But the Earlier function don't work in a measure. Has anyone an idea?

 

I always want to find the first picking date depending on the type. If I select a second filter (e.g. field) I still want to mark the first picking dates

 

IDTypeFieldCustomerPicking DateBest beforeMeasure
3BananaBX01.03.201901.04.20191
5AppleBX01.03.201901.04.20191

 

Best regards

Timo

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try this MEASURE

 

=
IF (
    SELECTEDVALUE ( TableName[Picking Date] )
        = CALCULATE (
            MIN ( TableName[Picking Date] ),
            VALUES ( TableName[Type] ),
            ALLSELECTED ( TableName )
        ),
    1,
    0
)

View solution in original post

5 REPLIES 5
Zubair_Muhammad
Community Champion
Community Champion

@Anonymous 

 

Try this MEASURE

 

=
IF (
    SELECTEDVALUE ( TableName[Picking Date] )
        = CALCULATE (
            MIN ( TableName[Picking Date] ),
            VALUES ( TableName[Type] ),
            ALLSELECTED ( TableName )
        ),
    1,
    0
)
Anonymous
Not applicable

Hi @Zubair_Muhammad ,

 

many thanks for your fast reply and your solution.

First of all the measure works fine. Thank you.

But my column chart don't. Do you know why?

 

SOP.PNG

 

Best regards

Timo

@Anonymous 

 

Could you share your file. I will try to help

 

Regards,

Zubair

Anonymous
Not applicable

@Zubair_Muhammad 

 

Sorry but because of our directives I am not able to upload my file.

 

It is a stacked column chart.

Axis is "Best before" with Hierarchy year and month and the value is Measure. With a (sum) column in the chart it works fine. So I think there is the problem, but I am not able to sum the measure.

Anonymous
Not applicable

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!

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.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.