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.
I have a table to be loaded into Power BI. There are 3 columns I am concerned with: Project_Name, Document_Name, Modified. The data in the table is something like this:
| Project_Name | Document_Name | Modified | +------------------+-------------------+--------------+ | Thing1 | Apple | 12/28/2019 | +------------------+-------------------+--------------+ | Thing1 | Orange | 10/22/2019 | +------------------+-------------------+--------------+ | Thing2 | Banana | 12/17/2019 | +------------------+-------------------+--------------+ | Thing2 | Banana | 12/30/2019 | +------------------+-------------------+--------------+
I want to filter the table such that the latest Modified date for each Project_Name shows, like this:
| Project_Name | Document_Name | Modified | +------------------+-------------------+--------------+ | Thing1 | Apple | 12/28/2019 | +------------------+-------------------+--------------+ | Thing2 | Banana | 12/30/2019 | +------------------+-------------------+--------------+
I tried adding a column to the table, to add a True value to the most recent date for each project. I pretty much just copied a formula I found on these forums. It returned correct results but omitted many records. This was the formula:
Documents'[Modified]),FILTER(ALL('Project Documents'), 'Project Documents'[ProjectName]=EARLIER('Project Documents'[ProjectName])))
Solved! Go to Solution.
Hi @Anonymous ,
Here we go:
Measure =
VAR maxd =
CALCULATE (
MAX ( 'Table'[Modified] ),
ALLSELECTED ( 'Table' ),
VALUES ( 'Table'[Project_Name] )
)
RETURN
IF ( MAX ( 'Table'[Modified] ) = maxd, 1, BLANK () )
Pbix as attached.
Hi @Anonymous ,
Here we go:
Measure =
VAR maxd =
CALCULATE (
MAX ( 'Table'[Modified] ),
ALLSELECTED ( 'Table' ),
VALUES ( 'Table'[Project_Name] )
)
RETURN
IF ( MAX ( 'Table'[Modified] ) = maxd, 1, BLANK () )
Pbix as attached.
@Anonymous ,
Try like adding this measure to the visual
Measure =
VAR __id = MAX ( 'Table'[project_name] )
VAR __date = CALCULATE ( MAX( 'Table'[Modified] ), ALLSELECTED ( 'Table' ), 'Table'[project_name] = __id )
RETURN CALCULATE ( count ( 'Table'[project_name] ), VALUES ( 'Table'[project_name ), 'Table'[project_name] = __id, 'Table'[Modified] = __date )
You should be able to create a selector column or measure:
Column =
VAR __Max = MAXX(FILTER('Table',[Project_Name] = EARLIER('Table'[Project_Name])),[Modified])
RETURN
IF([Modified] = __Max,1,0)
Measure =
VAR __Max = MAXX(FILTER(ALL('Table'),[Project_Name = MAX('Table'[Project_Name]),[Modified])
RETURN
IF(MAX([Modified]) = __Max,1,0)
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 |
---|---|
67 | |
61 | |
52 | |
36 | |
36 |
User | Count |
---|---|
84 | |
74 | |
56 | |
45 | |
44 |