Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!
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.
Vote for your favorite vizzies from the Power BI World Championship submissions!
If you love stickers, then you will definitely want to check out our Community Sticker Challenge!
Check out the January 2026 Power BI update to learn about new features.
| User | Count |
|---|---|
| 62 | |
| 53 | |
| 42 | |
| 20 | |
| 17 |
| User | Count |
|---|---|
| 122 | |
| 104 | |
| 45 | |
| 31 | |
| 24 |