The ultimate Microsoft Fabric, Power BI, Azure AI, and SQL learning event! Join us in Stockholm, Sweden from September 24-27, 2024.
2-for-1 sale on June 20 only!
Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started
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) | Entity | Status | |
1 | 01/01/2024 | Entity 1 | Inactive |
2 | 01/01/2024 | Entity 2 | Inactive |
3 | 02/01/2024 | Entity 2 | Active |
4 | 03/01/2024 | Entity 1 | Active |
5 | 03/01/2024 | Entity 3 | Active |
6 | 04/01/2024 | Entity 2 | Inactive |
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!
@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) | Entity | Status | |
1 | 01/01/2024 | Entity 1 | Inactive |
2 | 01/01/2024 | Entity 2 | Inactive |
3 | 02/01/2024 | Entity 2 | Active |
4 | 03/01/2024 | Entity 1 | Active |
5 | 03/01/2024 | Entity 3 | Active |
6 | 04/01/2024 | Entity 2 | Inactive |
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.
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
Thanks - will give it a go 🙂
Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.
Check out the June 2024 Power BI update to learn about new features.
User | Count |
---|---|
99 | |
93 | |
81 | |
63 | |
56 |
User | Count |
---|---|
247 | |
122 | |
110 | |
77 | |
72 |