Power BI is turning 10, and we’re marking the occasion with a special community challenge. Use your creativity to tell a story, uncover trends, or highlight something unexpected.
Get startedJoin us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.
Hi everyone. I have data that looks like this:
TestCaseID | Configuration | RunDate |
1 | 1 | 08-04-2021 11:10:10 |
1 | 1 | 08-04-2021 12:10:10 |
1 | 2 | 08-04-2021 13:10:10 |
2 | 1 | 08-04-2021 08:08:08 |
2 | 2 | 08-04-2021 09:09:09 |
2 | 2 | 08-04-2021 10:10:10 |
3 | 1 | 08-04-2021 09:09:09 |
3 | 1 | 08-04-2021 11:11:11 |
3 | 2 | 08-04-2021 10:10:10 |
I have a table in my PBI report where the user can select test cases, and whatever configurations they want through slicers. I want the table to only display the latest test run within the configuration.
So I ideally would create a calculated column that checks whether the current test/configuration is the last one for the configuration. The data output should look something like this:
TestCaseID | Configuration | RunDate | FilterCheck |
1 | 1 | 08-04-2021 11:10:10 | Remove |
1 | 1 | 08-04-2021 12:10:10 | Keep |
1 | 2 | 08-04-2021 13:10:10 | Keep |
2 | 1 | 08-04-2021 08:08:08 | Keep |
2 | 2 | 08-04-2021 09:09:09 | Remove |
2 | 2 | 08-04-2021 10:10:10 | Keep |
3 | 1 | 08-04-2021 09:09:09 | Remove |
3 | 1 | 08-04-2021 11:11:11 | Keep |
3 | 2 | 08-04-2021 10:10:10 | Keep |
This is the code I have so far:
Solved! Go to Solution.
Hi, @KasperBI
Please correct me if I wrongly understood your question.
Please check the below Calculated Column and the link down below, which is the sample pbix file.
Latest Test Column =
VAR lastnonblankcheck =
CALCULATE (
LASTNONBLANK ( 'Test Results'[RunDate], MAX ( 'Test Results'[Configuration] ) ),
ALLEXCEPT (
'Test Results',
'Test Results'[TestCaseID],
'Test Results'[Configuration]
)
)
RETURN
IF ( 'Test Results'[RunDate] = lastnonblankcheck, "Keep", "Remove" )
https://www.dropbox.com/s/xxpqyuj3xk6l2or/KasperBI.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Hi, @KasperBI
Please correct me if I wrongly understood your question.
Please check the below Calculated Column and the link down below, which is the sample pbix file.
Latest Test Column =
VAR lastnonblankcheck =
CALCULATE (
LASTNONBLANK ( 'Test Results'[RunDate], MAX ( 'Test Results'[Configuration] ) ),
ALLEXCEPT (
'Test Results',
'Test Results'[TestCaseID],
'Test Results'[Configuration]
)
)
RETURN
IF ( 'Test Results'[RunDate] = lastnonblankcheck, "Keep", "Remove" )
https://www.dropbox.com/s/xxpqyuj3xk6l2or/KasperBI.pbix?dl=0
Hi, My name is Jihwan Kim.
If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.
Thank you so much, that does seem to work.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
Check out the June 2025 Power BI update to learn about new features.
User | Count |
---|---|
74 | |
73 | |
56 | |
38 | |
31 |
User | Count |
---|---|
84 | |
63 | |
63 | |
49 | |
45 |