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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Penn
Resolver I
Resolver I

DAX Question: Return the first date based on another column

Hi Everyone,

 

My first post here, very new to Power BI. Let's imaging a table [Work Status] that looks like below.

 

Annotation 2019-03-05 134718.jpg

 

Now I want to create a new column to return the first date of Finished status for each unique Item ID which is 7/11/2013.

 

The DAX which I wrote doesn't work:

Status Finished Date = CALCULATE(MIN('Work Status'[Date From], FILTER('Work Status', 'Work Status'[Status] = "Finished"))

 

Proprobaly I should not use CALCULATE?

 

Need help thanks!

1 ACCEPTED SOLUTION

@Penn 

 

Sorry I think I misplaced the brackets

 

Try this one

 

Status Finished Date =
CALCULATE (
    MIN ( 'Work Status'[Date From] ),
    FILTER (
        ALLEXCEPT ( 'Work Status', 'Work Status'[item id] ),
        'Work Status'[Status] = "Finished"
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

4 REPLIES 4
Zubair_Muhammad
Community Champion
Community Champion

@Penn 

 

Try with this revision

 

Status Finished Date =
CALCULATE (
    MIN (
        'Work Status'[Date From],
        FILTER (
            ALLEXCEPT ( 'Work Status', 'Work Status'[item id] ),
            'Work Status'[Status] = "Finished"
        )
    )
)

 


Regards
Zubair

Please try my custom visuals

Hi Zubair,

 

I tried your code in both measure and calculated column and it returns me the "single value cannot be determined" error.

 

How should I fix this?

 

 

@Penn 

 

Sorry I think I misplaced the brackets

 

Try this one

 

Status Finished Date =
CALCULATE (
    MIN ( 'Work Status'[Date From] ),
    FILTER (
        ALLEXCEPT ( 'Work Status', 'Work Status'[item id] ),
        'Work Status'[Status] = "Finished"
    )
)

Regards
Zubair

Please try my custom visuals

You are absolutely briliant!!! Thank you!!!

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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