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
RAJ_87
New Member

Querying recent data within a dataset

Hi All, 

 

I need some help putting together a DAX query using the below example. I have a dataset similar to the below and would need to query the most recent 'Status' for each entity. I've put together a sample dataset to help explain the issue I am facing:

 

 Date (dd/mm/yyyy)EntityStatus
101/01/2024Entity 1Inactive
201/01/2024Entity 2Inactive
302/01/2024Entity 2Active
403/01/2024Entity 1Active
503/01/2024Entity 3Active
604/01/2024Entity 2Inactive

 

I'm trying to see how I can retrieve the most recent Status for each Entity listed. With the above data, I would expect a response to show the following data:

 

- Entity 1: Active

- Entity 2: Inactive

- Entity 3: Active

 

Any assistance that could be provided would be greatly appreciated!

 

Thanks!

 

6 REPLIES 6
RAJ_87
New Member


@Ahmedx - Thanks for that. It had worked to a certain extent. Looking how I am retrieving / reporting the data, I am amending the original query.

 

Still using the below table as an example:

 

 Date (dd/mm/yyyy)EntityStatus
101/01/2024Entity 1Inactive
201/01/2024Entity 2Inactive
302/01/2024Entity 2Active
403/01/2024Entity 1Active
503/01/2024Entity 3Active
604/01/2024Entity 2Inactive

 

Is there a way for me to count the most recent status for each entity? The result will return the number based on the requested status within the query. If I query for 'Inactive' status, I would like to see '1' as the result since Entity 2 is the most recent entity to appear as Inactive. If I query for 'Active' status, I would like to see '2' as the result since 'Entity 1' and 'Entity 3' has their most recent status as Active. 

 

Hope that makes sense.

 

pls try this

Screenshot_1.png

Hi,

PBI file attached.

Hope this helps.

Ashish_Mathur_0-1706752878994.png

 


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

I can’t understand the number 1 and 2 based on what
can you explain the logic in detail
and give a few examples where 1 or 2 or 3 suddenly exist

Ahmedx
Super User
Super User

pls try this

Screenshot_1.png

Thanks - will give it a go 🙂 

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.