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! Learn more

Reply
crombinator
New Member

Create a measure to display in a card based only on a visual and not all page filter

Hello,

 

So it seems I am almost there, but here is the issue. I have a table of people where they belong to two groups (Group A and Group B). The entire population on each visual can be displayed no issue, and if I apply a visual filter for Group B then I can see only that portion of the population in that filter.

 

The issue is I want to use a card that shows the total of all filtered population in that visual. As an example:

 

Total population is 100,000 with no filters for Group A/Group B. With Group A showing of hair colours in the donut chart, and the Group B shows eye color in that donut chart.

 

I apply an all Page filter to show me the population with blonde hair. That changes the total visual on both donuts to 40,000. Now I can go to the Group B visualization where I display eye colour, and I can change that visualization filter to only Brown. So the chart now displays as only 'Brown' and is 10,000.

 

The issue I have is I want a card inside each donut to display the total population for each filter. The Group A is easy because that is based on the All Page filter and so it will always show the correct total. The problem is the Group B I need to show the visualization applied filter. If the card just has: 

 

Hair Population = count(TotalPop[PersonId]) then that only shows the total based on the all pages filter.

 

I got close with:

 

Eye Population = CALCULATE ( COUNT (TotalPop[PersonId]),

KEEPFILTERS ( ( TotalPop[EyeColor] IN { "Brown", "Blue", "Hazel", "Green", "Other"} ) ) )

 

But obviously that is not based on the visualization filter, and just shows the total eye color population. Is there a way to JUST show the total for the eye colour filtered population based on the totals of the donut chart? I mean the amounts are in the data labels, but I am just starting to learn DAX and I am trying to figure out if I can get the totals as show from those labels.

6 REPLIES 6
crombinator
New Member

Here is an example with 50 elements. The card in the 'Eye Colour' does not have any Dax applied. I know that I can just apply the filter for the card visualization so that it matches the donut chart, but I was hoping to be able to do this using a DAX formula.

 

Here is the desired result with 1000 elements:

 

examplePowerBI.png

 

PersonIdhairColoureyeColour
1RedHazel
2BrownHazel
3GreyBrown
4BrownBrown
5OtherOther
6OtherHazel
7RedHazel
8RedGreen
9OtherGreen
10RedBlue
11GreyBrown
12OtherHazel
13GreyHazel
14BlondeBlue
15BlondeBlue
16BlondeOther
17BlondeBlue
18BrownOther
19BrownOther
20BrownGreen
21RedGreen
22OtherOther
23RedBrown
24GreyHazel
25GreyBlue
26OtherGreen
27BrownHazel
28BrownOther
29GreyGreen
30GreyOther
31BrownGreen
32BlondeGreen
33RedBlue
34RedBlue
35OtherOther
36RedHazel
37BrownBlue
38BrownBrown
39OtherBrown
40GreyBrown
41BlondeOther
42OtherGreen
43BrownOther
44BlondeGreen
45RedBlue
46RedOther
47OtherGreen
48OtherBrown
49GreyHazel
50GreyOther

I got the file but still didn't understand what is the desired result...

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Sorry, my screenshot is still incorrect. Basically what I want is if I select the Visualization filter for eyeColour I want the card to reflect what is selected there. Instead of showing the Total like this:

 

examplePowerBI_Update.png

I would like it to show the same value as the Visualization filter, and not the All Pages filter:

examplePowerBI_UpdateCorrect.png

Sorry, I still don't understand....
Generally to ignore the filter you can use all / allselected dax functions.


Take a look at the linked video:
https://www.youtube.com/watch?v=6t5D7K8jZvc

Unfortunately, I can't suggest something more detailed.

If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.


Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Here is a description of what I have done:

  1. All Pages filter has hairColour selected as Blonde which then displays 190 for both charts
  2. On the eyeColour chart you can select the Visualization filter as Brown which then shows my first example
  3. And then the third example I want a Measure to use in a Card that will show the actual value of 35 without having to manually click the card and match the Visualization filter from the eyeColour donut chart. So if I select Brown/Blue filter on the donut chart it will show the total value of the selections in that card instead of having to select the Card and selecting Brown/Blue manually.
Ritaf1983
Super User
Super User

Hi @crombinator 

Please provide sample data that covers your issue or question completely, in a usable format (not as a screenshot).
https://community.powerbi.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-Forum/ba-...
Please show the expected outcome based on the sample data you provided.

https://community.powerbi.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447523

Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Helpful resources

Announcements
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!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

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

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