Advance your Data & AI career with 50 days of live learning, dataviz contests, hands-on challenges, study groups & certifications and more!
Get registeredGet Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request 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.
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!
| User | Count |
|---|---|
| 97 | |
| 73 | |
| 50 | |
| 46 | |
| 44 |