Forum Discussion
Measure in chart
Hi all,
I created a measure which works fine in table. But if I add it to a chart, it shows different values.
My Data
| 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 |
Add this measure to always find the first picking date depending on the type.
Measure =
IF (
SELECTEDVALUE ( TableName[Picking Date] )
= CALCULATE (
MIN ( TableName[Picking Date] ),
VALUES ( TableName[Type] ),
ALLSELECTED ( TableName )
),
1,
0
)
In the table it is correct but in the chart I get this
I think I have to SUM the Measure in the chart, but this is not possible. Any idea how to fix it?
Best regards
Timo
- Anonymous7 years ago
PickFirst = IF ( ISFILTERED ( Table1[Customer] ), CALCULATE ( IF ( SELECTEDVALUE ( Table1[Picking Date] ) = CALCULATE ( MIN ( Table1[Picking Date] ), VALUES ( Table1[Type] ), ALLSELECTED ( Table1 ) ), 1, 0 ), FILTER ( Table1, IF ( SELECTEDVALUE ( Table1[Picking Date] ) = CALCULATE ( MIN ( Table1[Picking Date] ), VALUES ( Table1[Type] ), ALLSELECTED ( Table1 ) ), 1, 0 ) > 0 ) ), VALUES ( Table1[FirstPick] ) )Use this code.
First Pick is column created previous provided pbix.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
5 Replies
- AnonymousNot applicable
Anonymous ,
Refer below pbix.
There are 2 methods.
https://1drv.ms/u/s!Ah0UhoGdkH5biiHTPuHHieBOT6KF?e=OHGQFT
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AnonymousNot applicable
Hi Anonymous
thanks for your fast reply.
But I need a measure. With a calculated column I can't filter on e.g. customer and the picking date will be calculatet. It is still the same. So I need this measure.
Best regards
- AnonymousNot applicable
Anonymous ,
I am still not clear about your requirement.
You can use the measure created by you and change X-axis type to Categorical.
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.