- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Display Only those records where date is latest
I want to display data only for those student where date is latest. I dont want to show old dates associated with that student.
I want to do it in power bi /dax
PFB data:
Student | startdate | enddate |
A | 1-jan-2022 | 10-dec-2022 |
A | 1-jan-2022 | 25-jul-2023 |
A | 1-jan-2022 | 15-jan-2025 |
B | 4-apr-2023 | 10-dec-2022 |
B | 4-apr-2023 | 11-dec-2022 |
B | 4-apr-2023 | 25-jul-2023 |
Result I want
Student | startdate | enddate |
A | 1-jan-2022 | 15-jan-2025 |
B | 4-apr-2023 | 25-jul-2023 |
Solved! Go to Solution.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI @NG1407 ,
you can create this type of measure to find latest date
latest date = CALCULATE(MAX('Table (4)'[enddate]),ALLEXCEPT('Table (4)','Table (4)'[Student]))
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
HI @NG1407 ,
you can create this type of measure to find latest date
latest date = CALCULATE(MAX('Table (4)'[enddate]),ALLEXCEPT('Table (4)','Table (4)'[Student]))
If this post helps, then please give us Kudos and consider Accept it as a solution to help the other members find it more quickly.
Thank you
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
You solution works well when we have same records. It doesn't work when we have different records. As shown below
Result its giving...
Result it should give is: Latest date records only i.e.
Student | date | Remarks |
A | 2/3/2023 | Good |
B | 2/3/2025 | Good |
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Create a calculated column in the table to flag the first date of each student.
Last_Date_Flag =
VAR A =
CALCULATE(
MAX('Table'[EndDate]),
ALLEXCEPT('Table', 'Table'[StudentID])
)
RETURN
IF(A = 'Table'[EndDate], 1, 0)
Put this column to the visual level filter and filter 1. This way you will be able to show any data related to the last date for each student.
Did I answer your question? Mark my post as a solution! And Kudos are appreciated
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Yes this works fine. But its affecting other Dax too.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Can you show an example?
When visualizing how it is effecting other measures?
May be it will get fixed if you ignore this column in other measures. Adding all with this new column in other measures.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
@NG1407 , Go to modelling and create a new table
LatestRecords =
VAR LatestDates =
ADDCOLUMNS(
SUMMARIZE(
YourTable,
YourTable[Student],
"LatestEndDate", MAX(YourTable[enddate])
),
"startdate",
CALCULATE(
MAX(YourTable[startdate]),
YourTable[enddate] = [LatestEndDate]
)
)
RETURN
SELECTCOLUMNS(
LatestDates,
"Student", [Student],
"startdate", [startdate],
"enddate", [LatestEndDate]
)
Proud to be a Super User! |
|

Helpful resources
Join us at the Microsoft Fabric Community Conference
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Power BI Monthly Update - February 2025
Check out the February 2025 Power BI update to learn about new features.

Subject | Author | Posted | |
---|---|---|---|
08-06-2024 10:49 PM | |||
03-06-2023 03:13 AM | |||
08-05-2024 08:54 AM | |||
02-21-2024 04:47 AM | |||
08-28-2024 04:24 AM |
User | Count |
---|---|
25 | |
15 | |
11 | |
8 | |
8 |
User | Count |
---|---|
19 | |
15 | |
14 | |
14 | |
13 |