Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by watching the DP-600 session on-demand now through April 28th.
Learn moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register 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 April 2026 Power BI update to learn about new features.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
| User | Count |
|---|---|
| 41 | |
| 37 | |
| 32 | |
| 20 | |
| 15 |
| User | Count |
|---|---|
| 66 | |
| 58 | |
| 31 | |
| 25 | |
| 24 |