Get certified for free when you join Fabric Data Days 2026 and dive into Fabric, Power BI, SQL, AI, and other essential data skills.
Join nowData Days is here! Join us now for 60+ days of learning, challenges, and connection. Learn more
Hi,
I need a Measure which contains the EARLIER functionality.
My Table
| ID | Type | Field | Customer | Picking Date | Best before |
| 1 | Banana | A | X | 01.01.2019 | 01.02.2019 |
| 2 | Apple | A | Y | 01.02.2019 | 01.03.2019 |
| 3 | Banana | B | X | 01.03.2019 | 01.04.2019 |
| 4 | Banana | A | Y | 01.05.2019 | 01.06.2019 |
| 5 | Apple | B | X | 01.03.2019 | 01.04.2019 |
To find the first Picking Date by Type a add a Column and use the Earlier function and mark it with "1".
| ID | Type | Field | Customer | Picking Date | Best before | Column |
| 1 | Banana | A | X | 01.01.2019 | 01.02.2019 | 1 |
| 2 | Apple | A | Y | 01.02.2019 | 01.03.2019 | 1 |
| 3 | Banana | B | X | 01.03.2019 | 01.04.2019 | 0 |
| 4 | Banana | A | Y | 01.05.2019 | 01.06.2019 | 0 |
| 5 | Apple | B | X | 01.03.2019 | 01.04.2019 | 0 |
But now I want to filter by Customer and find the first picking dates (depending on the type)
| ID | Type | Field | Customer | Picking Date | Best before | Measure? |
| 1 | Banana | A | X | 01.01.2019 | 01.02.2019 | 1 |
| 3 | Banana | B | X | 01.03.2019 | 01.04.2019 | 0 |
| 5 | Apple | B | X | 01.03.2019 | 01.04.2019 | 1 |
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
| ID | Type | Field | Customer | Picking Date | Best before | Measure |
| 3 | Banana | B | X | 01.03.2019 | 01.04.2019 | 1 |
| 5 | Apple | B | X | 01.03.2019 | 01.04.2019 | 1 |
Best regards
Timo
Solved! Go to Solution.
@Anonymous
Try this MEASURE
=
IF (
SELECTEDVALUE ( TableName[Picking Date] )
= CALCULATE (
MIN ( TableName[Picking Date] ),
VALUES ( TableName[Type] ),
ALLSELECTED ( TableName )
),
1,
0
)
@Anonymous
Try this MEASURE
=
IF (
SELECTEDVALUE ( TableName[Picking Date] )
= CALCULATE (
MIN ( TableName[Picking Date] ),
VALUES ( TableName[Type] ),
ALLSELECTED ( TableName )
),
1,
0
)
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?
Best regards
Timo
@Anonymous
Could you share your file. I will try to help
Regards,
Zubair
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.
add a new post for the probelm
https://community.powerbi.com/t5/Desktop/Measure-in-chart/m-p/741785#M357637
Thanks.
Don't miss out on Data Days, June 15 through August 7. Learn Fabric, Power BI, SQL, AI and more.
Check out the May 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 23 | |
| 23 | |
| 20 | |
| 18 | |
| 14 |
| User | Count |
|---|---|
| 58 | |
| 51 | |
| 41 | |
| 30 | |
| 24 |