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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
CiaranC
Frequent Visitor

Can't create a static measure.

I have a Dashboard where I display population. I can select small population areas from a slicer, map visual or stacked bar chart and other visuals update to reflect these selections.

 

I am trying to get a card to update with the selected small percentage areas as a percentage of grand total when they are selected on either the map visual or stacked bar chart. I can get a measure to work with a slicer, but I can't get this to work when I select small areas using other visuals. I either get an error or 100%

  

I was going down two paths and neither seem to work no matter what I try or what I find for similar issues online. 

 

1. Create a static measure with the sum of population that doesn't change when items in visuals are selected. 

2. Allow me to create a measure that I can divide the total by only items selected. 

 

Any ideas or suggestions to point me in the right direction would be most helpful. 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @CiaranC ,

I create a table as you mentioned.

vyilongmsft_0-1717120915154.png

Then I create a measure and here is the DAX code.

Percent =
CALCULATE ( SUM ( 'Table'[Population] ) )
    / CALCULATE ( SUM ( 'Table'[Population] ), ALLSELECTED ( 'Table' ) )

I add a slicer and I can use it in any visual.

vyilongmsft_1-1717121101427.png

 

 

 

Best Regards

Yilong Zhou

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

3 REPLIES 3
Anonymous
Not applicable

Hi @CiaranC ,

I create a table as you mentioned.

vyilongmsft_0-1717120915154.png

Then I create a measure and here is the DAX code.

Percent =
CALCULATE ( SUM ( 'Table'[Population] ) )
    / CALCULATE ( SUM ( 'Table'[Population] ), ALLSELECTED ( 'Table' ) )

I add a slicer and I can use it in any visual.

vyilongmsft_1-1717121101427.png

 

 

 

Best Regards

Yilong Zhou

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

 

Thanks Yilong. Good to get this solution but could get this working with a slicer but not by using a visual. I did get a solution using two different measures, one to select all small areas and the second to only bring back data from areas selected on visual. 

Population All Areas Selected = CALCULATE([# Population total], ALL('2022_Data'[Small Areas]))
% Population All Areas Selected = DIVIDE([# Population total],[# Population All Areas Selected])
CiaranC
Frequent Visitor

Got this working from the stacked bar chart but can't get it working from map visual. Doesn't seem to filter through the stacked bar chart visual.

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

Check out the September 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
Top Kudoed Authors