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
tienkien
Frequent Visitor

Count number of trainee improved compare to previous test score

Hello,

 

I have a score database of the trainees after training activities like this:

DateTraineeIDScoreCourseOder
1/25/2022141
1/25/2022251
1/25/2022351
1/25/2022451
1/25/2022561
3/26/2022142
3/26/2022252
3/26/2022372
3/26/2022452
3/26/2022542
5/15/2022183
5/15/20222103
5/15/2022343
5/15/2022493
5/15/2022513
7/16/2022144
7/16/2022224
7/16/2022334
7/16/2022474
7/16/2022594

 

I want to calculate how many trainees improved after training courses.

The improvement can be measured by any positive change between any two courses (data points) in a period:

Example:

for Q1-2022 (Jan to March), trainee number 1 wasn't improved  => not counted

for semi-annual (Jan to June), trainee number 1 was improved => counted

for the report from May to July, trainee number 1 was not improved => not counted

for the annual report (Jan to Dec), trainee number 1 was improved => counted

 

Thank you.

TK.

 

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @tienkien,

You can try to use the following measure formula to get the count of improved trainee:

formula =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            FILTER ( ALLSELECTED ( 'Table' ), [CourseOder] <= MAX ( 'Table'[CourseOder] ) ),
            [CourseOder],
            [TraineeID],
            [Score],
            "HistoryScore",
                MAXX (
                    FILTER (
                        ALLSELECTED ( 'Table' ),
                        [CourseOder] < EARLIER ( 'Table'[CourseOder] )
                            && [TraineeID] = EARLIER ( 'Table'[TraineeID] )
                    ),
                    [Score]
                )
        ),
        [HistoryScore] <> 0
            && [Score] > [HistoryScore]
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

3 REPLIES 3
v-shex-msft
Community Support
Community Support

HI @tienkien,

You can try to use the following measure formula to get the count of improved trainee:

formula =
COUNTROWS (
    FILTER (
        SUMMARIZE (
            FILTER ( ALLSELECTED ( 'Table' ), [CourseOder] <= MAX ( 'Table'[CourseOder] ) ),
            [CourseOder],
            [TraineeID],
            [Score],
            "HistoryScore",
                MAXX (
                    FILTER (
                        ALLSELECTED ( 'Table' ),
                        [CourseOder] < EARLIER ( 'Table'[CourseOder] )
                            && [TraineeID] = EARLIER ( 'Table'[TraineeID] )
                    ),
                    [Score]
                )
        ),
        [HistoryScore] <> 0
            && [Score] > [HistoryScore]
    )
)

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

@v-shex-msft 

It works exactly what I want.

 

Thank you very much!

TK

tienkien
Frequent Visitor

Does anyone have the solution to this problem?

 

Regards,

TK

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.