Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago
Solved

DAX : Create a filtered column based on another column

Hello, 

 

I'm struggling with a DAX column calculation, I want to create a column based on a specific row, there are information about columns concerned : 

 

- Event_Biztranslist : ID of parcel

- Event_Type : Type of event 

- Event_Time : Date/Time of the event 

- Readpoint_Type : "Tunnel" or "Reader" 

- Rank : for each parcel, ranking events by Event_Time (first = most ancient, last = most recent)

 

This is the rule : for each [Event_Biztranslist] print the [Readpoint_Type] associated to the first "ObjectEvent"

 

To illustrate :

 

 

 

The result in the new column should be : 

Reader

Reader

Reader

Reader

Reader

Tunnel

Tunnel

Tunnel

 

tex628 

Regards, 

Driss

  • Hi Anonymous ,

     

    Try this:

    Column =
    CALCULATE (
        FIRSTNONBLANK ( 'Table (2)'[Relation_Type], MIN ( 'Table (2)'[Event_Time] ) ),
        FILTER (
            ALLEXCEPT ( 'Table (2)', 'Table (2)'[Event_Biztranslist] ),
            'Table (2)'[Event_Type] = "OE"
        )
    )

     

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

5 Replies