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

The Power BI Data Visualization World Championships is back! It's time to submit your entry. Live now!

Reply
yj1111
Helper I
Helper I

MAX function

I have two tables:

Project Table:

Project Name

Project Code

Phase

 

 

 

 

 

 

 

 

 

 

 

 

 

Effort Table:

Project Code

Employee ID

Written Hours on the project code

 

 

 

 

 

 

 

 

 

 

 

 

 

 

I combine two tables with the key: Project Code.

 

I create a measure: Phase = Max('Project'[Phase]), then I drag 'Project' Project Name, 'Effort' Project Code, and Measure 'Phase' to create a table. The Project Code is not the project code of the project, but the project codes of all the projects?

 

New Table:

 

Project Name

Project Code

Phase

Project 1

Project1 Code

Project 1 Phase

Project 1

Project2 Code

Project 1 Phase

Project 1

Project3 Code

Project 1 Phase

Project 1

Project4 Code

Project 1 Phase

 

 

I know in this case I can easily drag 'Project'[Phase] to create the new table. But I need this measure for creating some other measures and calculations. So I want to know the reason behind. Could someone help me here? Many thanks!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @yj1111 ,

 

My guess is that the model might go something like this, noting the cross-filter arrows.

vcgaomsft_0-1686809843968.png

If so, you can change the direction of the crossfilter to BOTH in your code to ensure that * end are equally filtered to 1 end.

 

Phase2 = CALCULATE(MAX('Project Table'[Phase]),CROSSFILTER('Effort Table'[Project Code],'Project Table'[Project Code],Both))

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

View solution in original post

1 REPLY 1
Anonymous
Not applicable

Hi @yj1111 ,

 

My guess is that the model might go something like this, noting the cross-filter arrows.

vcgaomsft_0-1686809843968.png

If so, you can change the direction of the crossfilter to BOTH in your code to ensure that * end are equally filtered to 1 end.

 

Phase2 = CALCULATE(MAX('Project Table'[Phase]),CROSSFILTER('Effort Table'[Project Code],'Project Table'[Project Code],Both))

 

Best Regards,
Gao

Community Support Team

 

If there is any post helps, then please consider Accept it as the solution  to help the other members find it more quickly. If I misunderstand your needs or you still have problems on it, please feel free to let us know. Thanks a lot!

How to get your questions answered quickly --  How to provide sample data in the Power BI Forum

Helpful resources

Announcements
December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.