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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
meklund
Frequent Visitor

Calc Column marking earliest dates

Hello, 

Just started using DAX, powerpivot, and power BI and loving it. I'm trying to make a Calc Column for the earliest project date for each of our agents (sample data below). I imagine it looks something like SWITCH(TRUE,AND([Date of Project]=??,[agent code]=??),"FIRST PROJECT","") that goes into the flag column. 

but any help would be cool 🙂

AgentCodeProjectDateProjectNameFLAG?
1234566/4/2019Project 212 
1234563/1/2020Project 564 
1234569/23/2020Project 951 
2345679/2/2020Project 367 
45678912/7/2019Project 852 
4567893/9/2020Project 264 
1 ACCEPTED SOLUTION
mahoneypat
Microsoft Employee
Microsoft Employee

You should probably do this as a measure instead but it is common for people new to Power BI to overuse calculated columns.  Here is a column expression to get your result, but it would work as a measure too (in a table visual with the AgentCode column).

 

First Project Date = CALCULATE(MIN(Table[ProjectDate]), ALLEXCEPT(Table, Table[AgentCode]))

 

Regards,

Pat

 

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


View solution in original post

1 REPLY 1
mahoneypat
Microsoft Employee
Microsoft Employee

You should probably do this as a measure instead but it is common for people new to Power BI to overuse calculated columns.  Here is a column expression to get your result, but it would work as a measure too (in a table visual with the AgentCode column).

 

First Project Date = CALCULATE(MIN(Table[ProjectDate]), ALLEXCEPT(Table, Table[AgentCode]))

 

Regards,

Pat

 

 





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

Check out the August 2025 Power BI update to learn about new features.

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.