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
Camstr
Helper I
Helper I

New Measure to filter based on two parameters

Hello,

I have a database that contains school test results by class and subject. 

The database is updated with the latest results and retains all previous records.

I want to make a Power BI report where I can visualise the latest average grade by class and subject based upon the most recent test date.

I need the report to update everytime new tests are taken, these will be future unknown dates.

See attached screenshot of what I have and what I want.

I know that I need a new measure here, but I am struggling to 'FILTER(ALLEXCEPT...' across two different tables.

Thanks in advance

 

Capture3.JPGCapture.JPG

1 ACCEPTED SOLUTION
Dangar332
Super User
Super User

hi, @Camstr 

 

with your current date format "dd-mm-yyyy"  use below code 

just adjust your table and column name

latest test date = 
    min(parameter[test date])


updated grade = 
     MAXX(
        FILTER(parameter,
           parameter[test date]=[latest test date]
               ),
        parameter[average grade]
          )

 

out put like below

 

Dangar332_0-1698431184173.png

 

 

 

if date format like  "mm-dd-yyyy"  use below code 

just adjust your table and column name

latest test date = 
    max(parameter[test date])


updated grade = 
     MAXX(
        FILTER(parameter,
           parameter[test date]=[latest test date]
               ),
        parameter[average grade]
          )

 

View solution in original post

2 REPLIES 2
Camstr
Helper I
Helper I

Thanks! @Dangar332  Worked perfectly.

Dangar332
Super User
Super User

hi, @Camstr 

 

with your current date format "dd-mm-yyyy"  use below code 

just adjust your table and column name

latest test date = 
    min(parameter[test date])


updated grade = 
     MAXX(
        FILTER(parameter,
           parameter[test date]=[latest test date]
               ),
        parameter[average grade]
          )

 

out put like below

 

Dangar332_0-1698431184173.png

 

 

 

if date format like  "mm-dd-yyyy"  use below code 

just adjust your table and column name

latest test date = 
    max(parameter[test date])


updated grade = 
     MAXX(
        FILTER(parameter,
           parameter[test date]=[latest test date]
               ),
        parameter[average grade]
          )

 

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!

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.