Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
7 years ago
Solved

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 ...
  • Anonymous's avatar
    Anonymous
    7 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.