This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. We're covering it all. You won't want to miss it.
Learn moreGet Fabric Certified for FREE during AI Skills Fest. This week only. Secure your voucher now.
Hi,
I have a problem that I cannot resolve.
here is my table:
| Date | Student Name | Subject | Test Result |
| 08-Dec-23 | Amir A. | Math | 80 |
| 10-Dec-23 | Amir A. | Math | 90 |
| 05-Nov-23 | Baruch B. | History | 70 |
| 01-Dec-23 | Amir A. | Science | 65 |
| 01-Oct-23 | Baruch B. | Math | 92 |
| 1-Sep-23 | Baruch B. | Math | 85 |
I would like to have a column that indicates the last "Test Result" based on the Student Name and Subject.
for Amir A. - Math - I would like to get 90, because the test was done on Dec, 10th
for Baruch B. - Math - I would like to get 92
for Baruch B. - History - I would like to see 70
is this possible using a DAX in a column?
it's OK to get the number 90 for all rows of Amir A. , Math.
Thank you in advance,
Yuval
Solved! Go to Solution.
Create a new column and paste the following expression:
Note: Make sure to change 'Sheet1' to your table name.
@yuvalpi you can also do this
Measure =
VAR _grouping =
ALLEXCEPT ( 'Table 1', 'Table 1'[Student Name], 'Table 1'[Subject] ) //define GROUPBY columns here
VAR one =
CALCULATE ( MAX ( 'Table 1'[Date] ), _grouping ) // what is the max date by the above group
VAR two =
CALCULATE ( MAX ( 'Table 1'[Test Result] ), _grouping, 'Table 1'[Date] = one ) //what is the test result on max date partioned by grouping
RETURN
two
@yuvalpi you can also do this
Measure =
VAR _grouping =
ALLEXCEPT ( 'Table 1', 'Table 1'[Student Name], 'Table 1'[Subject] ) //define GROUPBY columns here
VAR one =
CALCULATE ( MAX ( 'Table 1'[Date] ), _grouping ) // what is the max date by the above group
VAR two =
CALCULATE ( MAX ( 'Table 1'[Test Result] ), _grouping, 'Table 1'[Date] = one ) //what is the test result on max date partioned by grouping
RETURN
two
Hi smpa01,
I tried your solution and it also works great!
much appreciated!
thank you,
Yuval
Hi Bibiano_Geraldo,
This is amazing!! thank you so much for you quick and proffessional help!
much appreciated,
Yuval
Create a new column and paste the following expression:
Note: Make sure to change 'Sheet1' to your table name.
Check out the May 2026 Power BI update to learn about new features.
Sign up to receive a private message when registration opens and key events begin.
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
| User | Count |
|---|---|
| 24 | |
| 24 | |
| 21 | |
| 21 | |
| 18 |
| User | Count |
|---|---|
| 56 | |
| 52 | |
| 49 | |
| 26 | |
| 25 |