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

Learn from the best! Meet the four finalists headed to the FINALS of the Power BI Dataviz World Championships! Register now

Reply
S_M_
Frequent Visitor

DAX Help

I am trying to get the highlighted final project risk rating for each Vendor and Product service based on maximum project ID. (highlighted rows).

I have below calculation but I get error on using Max(). Project_ID_Calc is a calculated field I created by removing the String from Project ID and converting it to whole number.

Flag = CALCULATE(MIN('Table1'[FINAL_PROJECT_RISK_RATING]), ALLEXCEPT('Table1','Table1'[VENDOR_ID],'Table1'[PRODUCT_SERVICE]),'Table1'[PROJECT_ID] = MAX('Table1'[PROJECT_ID_CALC]) )

 

S_M__0-1648584721039.png

 

Any help is much appreciated.

 

Thanks,

1 ACCEPTED SOLUTION

@S_M_ 

you can create a column

Column = 
VAR _max=CALCULATE(max('Table'[PROJECT_ID]),ALLEXCEPT('Table','Table'[VENDOR_ID],'Table'[PRODUCT_SERVICE]))
return maxx(FILTER('Table','Table'[VENDOR_ID]=EARLIER('Table'[VENDOR_ID])&&'Table'[PROJECT_ID]=_max),'Table'[FINAL_PROJECT_RISK_RATING])

1.png

or a measure

measure = 
VAR _max=CALCULATE(max('Table'[PROJECT_ID]),ALLEXCEPT('Table','Table'[VENDOR_ID],'Table'[PRODUCT_SERVICE]))
return maxx(FILTER(all('Table'),'Table'[VENDOR_ID]=max('Table'[VENDOR_ID])&&'Table'[PROJECT_ID]=_max),'Table'[FINAL_PROJECT_RISK_RATING])

2.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




View solution in original post

3 REPLIES 3
S_M_
Frequent Visitor

Thanks, this was helpful, however, I would like to get the final project risk rating for that condition. I am trying to get this flag:

 

Again, any help is much appreciated.

VENDOR_IDPRODUCT_SERVICEPROJECT_IDFINAL_PROJECT_RISK_RATINGFlag
Vend-0031ABCTP-234Above levelAbove level
Vend-0031ABCTP-235Needs ImprovementAbove level
Vend-0031ABCTP-236Needs ImprovementAbove level
Vend-0031ABCTP-237Needs ImprovementAbove level
Vend-0031ABCTP-238Above levelAbove level
Vend-0031DEFTP-1245Needs ImprovementAbove level
Vend-0031DEFTP-1256Above levelAbove level
Vend-0031DEFTP-1247Needs ImprovementAbove level
Vend-0031DEFTP-1248Above levelAbove level

@S_M_ 

you can create a column

Column = 
VAR _max=CALCULATE(max('Table'[PROJECT_ID]),ALLEXCEPT('Table','Table'[VENDOR_ID],'Table'[PRODUCT_SERVICE]))
return maxx(FILTER('Table','Table'[VENDOR_ID]=EARLIER('Table'[VENDOR_ID])&&'Table'[PROJECT_ID]=_max),'Table'[FINAL_PROJECT_RISK_RATING])

1.png

or a measure

measure = 
VAR _max=CALCULATE(max('Table'[PROJECT_ID]),ALLEXCEPT('Table','Table'[VENDOR_ID],'Table'[PRODUCT_SERVICE]))
return maxx(FILTER(all('Table'),'Table'[VENDOR_ID]=max('Table'[VENDOR_ID])&&'Table'[PROJECT_ID]=_max),'Table'[FINAL_PROJECT_RISK_RATING])

2.PNG

 





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




ryan_mayu
Super User
Super User

@S_M_ 

here is a workaround for you.

Measure = IF(CALCULATE(MAX('Table'[ProjectID]),ALLEXCEPT('Table','Table'[Vendor_ID],'Table'[Product]))=MAX('Table'[ProjectID]),1,0)

 

then set up conditional formatting to change the color

1.PNG

pls see the attachment below





Did I answer your question? Mark my post as a solution!

Proud to be a Super User!




Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

February Power BI Update Carousel

Power BI Monthly Update - February 2026

Check out the February 2026 Power BI update to learn about new features.

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.