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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
Power_It_Up
Helper I
Helper I

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.

 

Power_It_Up_0-1711129674811.png

 

Many thanks in advance.

1 ACCEPTED SOLUTION
QuentinBl
Helper I
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.
QuentinBl_0-1711131137977.png


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]))
QuentinBl_1-1711131601055.png

 



 



View solution in original post

3 REPLIES 3
Power_It_Up
Helper I
Helper I

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

Hi, @Power_It_Up 

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

 

 

Best Regards

Jianpeng Li

 

 

QuentinBl
Helper I
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.
QuentinBl_0-1711131137977.png


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]))
QuentinBl_1-1711131601055.png

 



 



Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

Top Solution Authors