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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
AFra
Helper III
Helper III

Measure calculation of a score based on several criteria

Hi all,
I need to create a measure in which I take in account several criteria to calculate a score :
- if DEMANDE_MUTATION = BLANK then 0, else YEAR(TODAY) - YEAR(DEMANDE_MUTATION)
- if PMO = 1 then 80
- if DEROG = 1 then 50
- if PMO = 1 AND :
                               MEMBRE_PLUS_AGE = 60 then 5
                               MEMBRE_PLUS_AGE >= 61 AND <65 then 10
                               MEMBRE_PLUS_AGE >= 65 then 15
if DEMANDE_MUTATION <> BLANK AND ECART >1
                               MEMBRE_PLUS_AGE >= 60 AND <65 then 10
                               MEMBRE_PLUS_AGE >= 65 then 15
return = sum of all values

 

example : if someone is PMO and MEMBRE_PLUS_AGE = 63, he will get 90 points.
I can do the calculation with several columns, but I'd like to use a measure.
Can someone help me? 

Here's a sample of the data 

 

THanks in advance, 

Ana 

1 ACCEPTED SOLUTION
v-jingzhang
Community Support
Community Support

Hi @AFra 

 

I cannot download the sample data from your link. Can you share it again?

 

Or you may create a measure similar to below. 

Measure = 
VAR a =
    IF (
        ISBLANK ( SELECTEDVALUE ( 'Table'[DEMANDE_MUTATION] ) ),
        0,
        YEAR ( TODAY () ) - YEAR ( SELECTEDVALUE ( 'Table'[DEMANDE_MUTATION] ) )
    )
VAR b = IF ( SELECTEDVALUE ( 'Table'[PMO] ) = 1, 80 )
VAR c = IF ( SELECTEDVALUE ( 'Table'[DEROG] ) = 1, 50 )
VAR d =
    IF (
        SELECTEDVALUE ( 'Table'[PMO] ) = 1,
        SWITCH (
            TRUE (),
            SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) = 60, 5,
            SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) >= 61 && SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) < 65, 10,
            SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) >= 65, 15
        )
    )
VAR e =
    IF (
        ( NOT ISBLANK ( SELECTEDVALUE ( 'Table'[DEMANDE_MUTATION] ) ) ) && SELECTEDVALUE ( 'Table'[ECART] ) > 1,
        IF (
            SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) >= 60 && SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) < 65,
            10,
            IF ( SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) >= 65, 15 )
        )
    )
RETURN
    a + b + c + d + e

vjingzhang_0-1682499423245.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

View solution in original post

1 REPLY 1
v-jingzhang
Community Support
Community Support

Hi @AFra 

 

I cannot download the sample data from your link. Can you share it again?

 

Or you may create a measure similar to below. 

Measure = 
VAR a =
    IF (
        ISBLANK ( SELECTEDVALUE ( 'Table'[DEMANDE_MUTATION] ) ),
        0,
        YEAR ( TODAY () ) - YEAR ( SELECTEDVALUE ( 'Table'[DEMANDE_MUTATION] ) )
    )
VAR b = IF ( SELECTEDVALUE ( 'Table'[PMO] ) = 1, 80 )
VAR c = IF ( SELECTEDVALUE ( 'Table'[DEROG] ) = 1, 50 )
VAR d =
    IF (
        SELECTEDVALUE ( 'Table'[PMO] ) = 1,
        SWITCH (
            TRUE (),
            SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) = 60, 5,
            SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) >= 61 && SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) < 65, 10,
            SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) >= 65, 15
        )
    )
VAR e =
    IF (
        ( NOT ISBLANK ( SELECTEDVALUE ( 'Table'[DEMANDE_MUTATION] ) ) ) && SELECTEDVALUE ( 'Table'[ECART] ) > 1,
        IF (
            SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) >= 60 && SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) < 65,
            10,
            IF ( SELECTEDVALUE ( 'Table'[MEMBRE_PLUS_AGE] ) >= 65, 15 )
        )
    )
RETURN
    a + b + c + d + e

vjingzhang_0-1682499423245.png

 

Best Regards,
Community Support Team _ Jing
If this post helps, please Accept it as Solution to help other members find it.

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 2025 Power BI update to learn about new features.

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors
Top Kudoed Authors