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

Be one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.