Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
Anonymous
Not applicable

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

IDTypeFieldCustomerPicking DateBest before
1BananaAX01.01.201901.02.2019
2AppleAY01.02.201901.03.2019
3BananaBX01.03.201901.04.2019
4BananaAY01.05.201901.06.2019
5AppleBX01.03.201901.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

Banana.PNG

 

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

1 ACCEPTED SOLUTION
Anonymous
Not applicable

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.

View solution in original post

5 REPLIES 5
Anonymous
Not 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.

Anonymous
Not 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

Anonymous
Not 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.

Solution

 

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Anonymous
Not applicable

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.

Banana filter.PNG

 

Why I only have data for January? The Measure in March is also 1 ... Do you know what I mean?

Anonymous
Not applicable

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.

Helpful resources

Announcements
Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

Check out the March 2026 Power BI update to learn about new features.