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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
edcdcpowerbi
Helper I
Helper I

CALCULATE filtering table by conditional measure

I have two measures which calculate initial and final scores. 

I now wish to have a measure which has all the clients who finished with a higher final score. 

A bit lost on how to go about it, this is what i currently have which does not work. 

Would appreciate any help and advice

 

CALCULATE( COUNT( 'Client'[ID]) , [Final Score] > [Initial Score] )

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

Hi @edcdcpowerbi ,

 

Please try the following formula:

 

Measure = 
CALCULATE (
    DISTINCTCOUNT ( 'Client'[ID] ),
    FILTER ( ALLSELECTED ( Client[ID] ), [Final Score] > [Initial Score] )
)

vkkfmsft_0-1644825337496.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

View solution in original post

8 REPLIES 8
v-kkf-msft
Community Support
Community Support

Hi @edcdcpowerbi ,

 

Please try the following formula:

 

Measure = 
CALCULATE (
    DISTINCTCOUNT ( 'Client'[ID] ),
    FILTER ( ALLSELECTED ( Client[ID] ), [Final Score] > [Initial Score] )
)

vkkfmsft_0-1644825337496.png

If the problem is still not resolved, please provide detailed error information or the expected result you expect. Let me know immediately, looking forward to your reply.
Best Regards,
Winniz
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

 

If you can share the details of Initial and Final Score will be better but you can try using the variable

 

 

MEASURE=

VAR x1=[Final Score]
VAR x2=[Initial Score]
RETURN
CALCULATE( COUNT( 'Client'[ID]) , x1>x2 )

 

 

Thanks for the help. It brings up the same semantic error i was getting in my initial measure unfortunately. 

@edcdcpowerbi if you can share the snapshot of your data and required output.

The output i am looking for is all the client IDs who have a higher final score. 

I've created two measures which give me total scores for intial and final, now i wish to calculate the client IDs that have a higher final score

The initial measures are creates with this measure: 

 

CALCULATE(SUM('Client')'[Total Score]),'Client[Stage] = "Final")

CALCULATE(SUM('Client')'[Total Score]),'Client[Stage] = "Initial")

Can you check the syntax of your measure. I think its not correct.

Syntax is correct for the initial and final measures, they are bringing through the correct numbers

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

Find out what's new and trending in the Fabric community.

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.