Forum Discussion

cromo's avatar
cromo
New Member
10 years ago
Solved

Date as a Value

Hi, 

I am trying to make a report where I have a Subject a score and the date of the test, 

 

So, I have my table

Subject_test:

Studentid SubjectID Subject Score Dateoftest

 

what I want to do is something similar to Pivot but i cant really add date as value what I want as a final imput is someting like this

                               SUBJECT 1

Student Id  || Subject 1 Score || Subject 1 Dateoftest ||....Subject N Score || Subject N Date of test||

 

I am able to add the score column since there are numbers but i cant add date column because it will count it.

 

 

can you help me with this?

 

thanks in advanced.

 

  • cromo

     

    The expected output looks kind of non-standard in my opinion. However you could follow the attached pbix to get it. You will duplicate one column and pivot twice in this case.

     

     



    I am able to add the score column since there are numbers but i cant add date column because it will count it.

     


    To avoid counting, you can apply another aggregate function like MAX or even not aggregated.

     

2 Replies

  • Eric_Zhang's avatar
    Eric_Zhang
    Microsoft Employee

    cromo

     

    The expected output looks kind of non-standard in my opinion. However you could follow the attached pbix to get it. You will duplicate one column and pivot twice in this case.

     

     



    I am able to add the score column since there are numbers but i cant add date column because it will count it.

     


    To avoid counting, you can apply another aggregate function like MAX or even not aggregated.