cancel
Showing results for
Did you mean:

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Frequent Visitor

## # of recent TaskID for each person

I was just thinking, is it possible to look up 3 or 5 most recent task for each person. (With dax measure)

 ID TaskID Name Datetime 8 7 Jame 30/06/2022 11:00 7 8 John 30/06/2022 10:00 6 3 Peter 25/06/2022 15:00 5 4 John 25/06/2022 10:00 4 6 Jame 24/06/2022 14:00 3 1 John 24/06/2022 10:00 2 5 Peter 23/06/2022 12:00 1 4 Peter 23/06/2022 11:00

To use it on a matrix Rows Name and 5 most recent task

Something like this : https://community.powerbi.com/t5/DAX-Commands-and-Tips/FILTER-statement-to-return-most-recent-record...

1 ACCEPTED SOLUTION
Community Support

Hi, @Twe-Maker

You can try the following methods.
Measure:

``````Rank =
RANKX (
FILTER ( ALL ( 'Table' ), [Name] = SELECTEDVALUE ( 'Table'[Name] ) ),
CALCULATE ( MAX ( 'Table'[Datetime] ) ),
,
DESC
)
``````

Suppose you want to display the last 2 Tasks.

``Measure = IF([Rank]<=2,1,0)``

This method can also be used in matrix.

Best Regards,

Community Support Team _Charlotte

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

3 REPLIES 3
Community Support

Hi, @Twe-Maker

You can try the following methods.
Measure:

``````Rank =
RANKX (
FILTER ( ALL ( 'Table' ), [Name] = SELECTEDVALUE ( 'Table'[Name] ) ),
CALCULATE ( MAX ( 'Table'[Datetime] ) ),
,
DESC
)
``````

Suppose you want to display the last 2 Tasks.

``Measure = IF([Rank]<=2,1,0)``

This method can also be used in matrix.

Best Regards,

Community Support Team _Charlotte

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

Solution Sage

DAX measures do not ever return tables. They can only return scalars.

Frequent Visitor

Thank you, I had a increment refresh on the table. I was trying to find a way to without creating a new column, but i guess back to power query. To create the RANKX in there.

Announcements

#### Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

#### Power BI Monthly Update - June 2024

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

#### New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

Top Solution Authors
Top Kudoed Authors