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
CTW
Regular Visitor

to show value in calculated column based on another column (lookup?)

Hi DAX professionals:

I've run into a issue where i'm trying to create a calculated column based off of other columns. please refer to the below screen shot to what my issue is:

 

Station                           S/N        TestTimeTest        Result             TestTimeFr        First Test result

terminator 11232/2/2018 13:00P2/2/2018 13:00P
terminator 11232/2/2018 13:15F2/2/2018 13:00P
terminator 11232/2/2018 15:00P2/2/2018 13:00P
terminator 11002/2/2018 14:00F2/2/2018 14:00F
terminator 11002/2/2018 14:20P2/2/2018 14:00F
terminator 11002/2/2018 14:21P2/2/2018 14:00F
terminator 11002/2/2018 14:30P2/2/2018 14:00F

I am trying to calculate column "First Test Result"  which fills the column with the very first test result value for that serial number.

i managed to calculate the column with the TestTime of the first test by using this DAX formula:

 

TestTimeFr = CALCULATE ( MIN ( 'Data'[TestTime]), FILTER ( 'data', 'Data'[S/N] = EARLIER ( 'Data'[S/N] ) && data[station] = EARLIER ( 'Data'[station] ) ) )

 

Now I just need some help to input the test result for the TestTimeFr in the column to get the First Test Result.

Any help is greatly appreciated!

1 ACCEPTED SOLUTION
Zubair_Muhammad
Community Champion
Community Champion

Hi @CTW

 

Try this column

 

First Test Result=
CALCULATE (
    FIRSTNONBLANK ( Data[Result], 1 ),
    FILTER (
        ALLEXCEPT ( Data, Data[Station], Data[S/N] ),
        Data[TestTimeTest] = Data[TestTimeFr]
    )
)

Regards
Zubair

Please try my custom visuals

View solution in original post

1 REPLY 1
Zubair_Muhammad
Community Champion
Community Champion

Hi @CTW

 

Try this column

 

First Test Result=
CALCULATE (
    FIRSTNONBLANK ( Data[Result], 1 ),
    FILTER (
        ALLEXCEPT ( Data, Data[Station], Data[S/N] ),
        Data[TestTimeTest] = Data[TestTimeFr]
    )
)

Regards
Zubair

Please try my custom visuals

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.