March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe 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
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.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
87 | |
87 | |
70 | |
51 |
User | Count |
---|---|
205 | |
153 | |
97 | |
79 | |
69 |