cancel
Showing results 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.

Frequent Visitor

## Selecting a particular value in a filter to return the total of all values

Hi there.

Simple table below.  If I filter on Person 'A', I want the SCORECARD to show 185.  Otherwise, show the corresponding Total of the selected Person, i.e. 'B' = 20, 'C' = 30,  and so on.

Many thanks in advance.

1 ACCEPTED SOLUTION
Helper I

Hello,
this measure should do the work :

Dax = IF(SELECTEDVALUE('Exemple 2'[Person]) = "A",CALCULATE(SUM('Exemple 2'[total]),ALL('Exemple 2'[Person])),SUM('Exemple 2'[total]))

It can be imporved with a 'switch' instead of a 'if' if you get other tests to do.

If you want your total to be corresponding to the new value shown in A, you can switch to this DAX with a SUMX :

Dax = SUMX('Exemple 2', IF('Exemple 2'[Person] = "A",CALCULATE(SUM('Exemple 2'[total]),ALL('Exemple 2')),'Exemple 2'[total]))

3 REPLIES 3
Frequent Visitor

@QuentinBl Many thanks for this example. I shall try it soon. 👍

Community Support

Hi, @Power_It_Up

Your solution is great, @QuentinBl . It worked like a charm! Has your current issue been resolved?

Best Regards

Jianpeng Li

Helper I

Hello,
this measure should do the work :

Dax = IF(SELECTEDVALUE('Exemple 2'[Person]) = "A",CALCULATE(SUM('Exemple 2'[total]),ALL('Exemple 2'[Person])),SUM('Exemple 2'[total]))

It can be imporved with a 'switch' instead of a 'if' if you get other tests to do.

If you want your total to be corresponding to the new value shown in A, you can switch to this DAX with a SUMX :

Dax = SUMX('Exemple 2', IF('Exemple 2'[Person] = "A",CALCULATE(SUM('Exemple 2'[total]),ALL('Exemple 2')),'Exemple 2'[total]))

Announcements

#### 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

#### Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

#### Fabric Community Update - April 2024

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

Top Solution Authors
Top Kudoed Authors