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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
sharath123
Helper I
Helper I

Based on two column filter conditions , need calculated column DAX expression

sharath123_0-1653546711496.png

Here we have Inspected dates as 26th Apr, 28th Apr, 3rd May, 4th May, 12th May, and 13th May (this is the latest date)
based on the vehicle number & latest date we need to get the max damage intensity value.

I have written dax expression as (calculated column)

max value of damage intensity = 
calculate(MAX(''Table1[damageIntensity]),ALLEXCEPT(Table1,Table1[Vehicle Number
]),KEEPFILTERS(LASTDATE(Table1[Inspected Date])))

But it is giving a different output 
like for 26th Apr

sharath123_1-1653548343782.png

 

and for 28th Apr

sharath123_2-1653548393852.png

for each different date, it is giving different max damage intensity values. but I need output as max damage intensity value for the latest date (i.e 13th may)

sharath123_3-1653548576867.png

Irrespective of each date, we need the max damage intensity value on the latest date. i.e value 6.
please help me to write/update my DAX expression.




1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @sharath123 

you can use

max value of damage intensity =
VAR VehicleTable =
    CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[Vehicle Number] ) )
VAR MaxDate =
    MAXX ( VehicleTable, Table1[Inspected Date] )
RETURN
    MAXX (
        FILTER ( VehicleTable, Table1[Inspected Date] = MaxDate ),
        Table1[damageIntensity]
    )

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @sharath123 

you can use

max value of damage intensity =
VAR VehicleTable =
    CALCULATETABLE ( Table1, ALLEXCEPT ( Table1, Table1[Vehicle Number] ) )
VAR MaxDate =
    MAXX ( VehicleTable, Table1[Inspected Date] )
RETURN
    MAXX (
        FILTER ( VehicleTable, Table1[Inspected Date] = MaxDate ),
        Table1[damageIntensity]
    )

 Thanks @tamerj1 It worked for me. you have given a detailed DAX expression, Thanks once again.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

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