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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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)

@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)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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