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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
Sri57
Frequent Visitor

trying to convert calculated column to measure in dax

I was trying to convert this dax column in to measure which I'm failing, Can anyone of you help me on this?
IF(ISBLANK([Ship Date]),BLANK(),
CALCULATE(MIN('Table A'[Ship Date]),
FILTER('Table A','Table A'[Customer]=EARLIER('Table A'[Customer])),
FILTER('Table A','Table A'[Status]="Shipped"),
FILTER('Table A','Table A'[Item]<>"TAP")))

2 ACCEPTED SOLUTIONS
Jihwan_Kim
Super User
Super User

HI,

I am not sure how your semantic model looks like or how your expected outcome of the visualization looks like, but please try something like below whether it suits your requirement.

 

expected result measure: =
CALCULATE (
    MIN ( 'Table A'[Ship Date] ),
    FILTER (
        'Table A',
        'Table A'[Ship Date] <> BLANK ()
            && 'Table A'[Customer]
                IN VALUES ( 'Table A'[Customer] )
                    && 'Table A'[Status] = "Shipped"
                    && 'Table A'[Item] <> "TAP"
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

Anonymous
Not applicable

Hi @Sri57 ,

You can create a measure as below to get it, and the precondition is the field [Ship Date] and [Customer] need to be applied on the visual.

Measure  =
VAR _shipdate =
    SELECTEDVALUE ( 'Table A'[Ship Date] )
VAR _customer =
    SELECTEDVALUE ( 'Table A'[Customer] )
RETURN
    IF (
        ISBLANK ( _shipdate ),
        BLANK (),
        CALCULATE (
            MIN ( 'Table A'[Ship Date] ),
            FILTER (
                ALLSELECTED ( 'Table A' ),
                'Table A'[Customer] = _customer
                    && 'Table A'[Status] = "Shipped"
                    && 'Table A'[Item] <> "TAP"
            )
        )
    )

vyiruanmsft_0-1708499737665.png

Best Regards

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @Sri57 ,

You can create a measure as below to get it, and the precondition is the field [Ship Date] and [Customer] need to be applied on the visual.

Measure  =
VAR _shipdate =
    SELECTEDVALUE ( 'Table A'[Ship Date] )
VAR _customer =
    SELECTEDVALUE ( 'Table A'[Customer] )
RETURN
    IF (
        ISBLANK ( _shipdate ),
        BLANK (),
        CALCULATE (
            MIN ( 'Table A'[Ship Date] ),
            FILTER (
                ALLSELECTED ( 'Table A' ),
                'Table A'[Customer] = _customer
                    && 'Table A'[Status] = "Shipped"
                    && 'Table A'[Item] <> "TAP"
            )
        )
    )

vyiruanmsft_0-1708499737665.png

Best Regards

talespin
Solution Sage
Solution Sage

hi @Sri57 

 

Please share sample data and data model.

Jihwan_Kim
Super User
Super User

HI,

I am not sure how your semantic model looks like or how your expected outcome of the visualization looks like, but please try something like below whether it suits your requirement.

 

expected result measure: =
CALCULATE (
    MIN ( 'Table A'[Ship Date] ),
    FILTER (
        'Table A',
        'Table A'[Ship Date] <> BLANK ()
            && 'Table A'[Customer]
                IN VALUES ( 'Table A'[Customer] )
                    && 'Table A'[Status] = "Shipped"
                    && 'Table A'[Item] <> "TAP"
    )
)

If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
July PBI25 Carousel

Power BI Monthly Update - July 2025

Check out the July 2025 Power BI update to learn about new features.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.