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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
kasiaw29
Resolver II
Resolver II

Max Value within table when condition is met

I need help with something I'm trying to acheieve. Seems simple but giving me a lot of grief. 

I simply need help with dax, I need to find max baseline revision no where cus search = 1.

So in below screenshot I'd only like to see highlighted line. 

kasiaw29_0-1599814000923.png

I have MAX LC 

IF(
CALCULATE(MAX('Activity History'[Baseline Revision No]),
ALLEXCEPT('Activity History',
'Activity History'[Project]))=MAX('Activity History'[Baseline Revision No]),1,0)
 
Can anyone help? 
1 ACCEPTED SOLUTION
FrankAT
Community Champion
Community Champion

Hello @kasiaw29

what about the following solution:

11-09-_2020_11-14-59.png

Max of LC Max = 
CALCULATE(
    MAX('Activity History'[Baseline Revision  No]),
    FILTER(
        ALLEXCEPT(
            'Activity History',
            'Activity History'[Project]
        ),
        'Activity History'[CUS Search] = 1
    )
)

With kind greetings from the city where the legend of the 'Pied Piper de Hamelin' is at home
FrankAT (Proud to be a Datanaut)

View solution in original post

6 REPLIES 6
Tahreem24
Super User
Super User

@kasiaw29 ,

Try this below DAX:

Max Rev No  = CALCULATE(MAX('Table'[Rev No.]),FILTER('Table','Table'[Cus Search]=1))
Capture.PNG
 
 
Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard
FrankAT
Community Champion
Community Champion

Hello @kasiaw29

what about the following solution:

11-09-_2020_11-14-59.png

Max of LC Max = 
CALCULATE(
    MAX('Activity History'[Baseline Revision  No]),
    FILTER(
        ALLEXCEPT(
            'Activity History',
            'Activity History'[Project]
        ),
        'Activity History'[CUS Search] = 1
    )
)

With kind greetings from the city where the legend of the 'Pied Piper de Hamelin' is at home
FrankAT (Proud to be a Datanaut)

Fantasric work! Exactly what I needed. Thank you very very much!

amitchandak
Super User
Super User

@kasiaw29 , Try to have a measure like

 

Measure =
VAR __id = MAX ('Activity History'[Project] )
VAR __dt = CALCULATE ( MAX('Activity History'[Baseline Revision No] ), ALLSELECTED ('Activity History' ), 'Activity History'[Project] = __id ,'Activity History'[cus search]=1)
CALCULATE ( Min ('Activity History'[Baseline Revision No] ), VALUES ('Activity History'[Project ),'Activity History'[Project] = __id,'Activity History'[Baseline Revision No] = __dt ,'Activity History'[cus search]=1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

@amitchandak  Unfortunately I'm getting this error 

 

kasiaw29_1-1599815268576.png

 

 

@kasiaw29 , my bad , return is missing

Measure =
VAR __id = MAX ('Activity History'[Project] )
VAR __dt = CALCULATE ( MAX('Activity History'[Baseline Revision No] ), ALLSELECTED ('Activity History' ), 'Activity History'[Project] = __id ,'Activity History'[cus search]=1)
return
CALCULATE ( Min ('Activity History'[Baseline Revision No] ), VALUES ('Activity History'[Project ),'Activity History'[Project] = __id,'Activity History'[Baseline Revision No] = __dt ,'Activity History'[cus search]=1)

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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.

Top Solution Authors