We've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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
Solved! Go to Solution.
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.
@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.
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
@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.
Hi @Anonymous
I like to show the first picking dates in a column chart. Depending on the filter the bar chart should change.
If you set a filter in your file it also doesn't show me the correct results.
Why I only have data for January? The Measure in March is also 1 ... Do you know what I mean?
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.
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.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 54 | |
| 37 | |
| 32 | |
| 17 | |
| 15 |
| User | Count |
|---|---|
| 66 | |
| 66 | |
| 39 | |
| 34 | |
| 25 |