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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Anonymous
Not applicable

Looking for a measure or calculated column to look at the last unitname grouped by eventidx

Hi all,

 

I am looking for a way to either create a measure or calculated column to get the last unitname per event_idx. Below is a picture with data attached.

 

CollinSharp1_0-1641483491768.png

 

As you can see, there are many updates to a single event, so I would like to know the best way to take the last unitname based on the action date field and group it by event_idx. If this was sql I could do this easily but I am not as familiar with dax so I am struggling with the correct formulas and syntax.

 

Any help would be appreciated. 

 

Thanks!!

1 ACCEPTED SOLUTION

Hi @Anonymous ,

 

If you want to calculate the last unitname based on the action date field and group it by event_idx. 

My Sample:

1.png

Measure = 
CALCULATE(MAX(TableName[UNITNAME]),FILTER(TableName,TableName[ACTIONDATE] = MAX(TableName[ACTIONDATE])))

Create a table visual by [EVENT_IDX] and [Measure]. 

Result is as below.

1.png

 

Best Regards,
Rico Zhou

 

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

3 REPLIES 3

Try with

 

=
CALCULATE (
    MAX ( TableName[ACTIONS] ),
    ALLEXCEPT (
        TableName,
        TableName[EVENT_IDX],
        TableName[ACTIONDATE]
    )
)

 

Anonymous
Not applicable

Is that a measure?? Thanks for the response!!

Hi @Anonymous ,

 

If you want to calculate the last unitname based on the action date field and group it by event_idx. 

My Sample:

1.png

Measure = 
CALCULATE(MAX(TableName[UNITNAME]),FILTER(TableName,TableName[ACTIONDATE] = MAX(TableName[ACTIONDATE])))

Create a table visual by [EVENT_IDX] and [Measure]. 

Result is as below.

1.png

 

Best Regards,
Rico Zhou

 

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

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.