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

A new Data Days event is coming soon! This time we’re going bigger than ever. Fabric, Power BI, SQL, AI and more. Don't miss out.

Reply
Anonymous
Not applicable

Dynamic Percentage calculation based on Selection

new to power bi so hoping some of you experts can help me.

 

the table below is highlighting kids shots on a goal, both using their right and left feet, and the number of times they failed to hit the target (broken down per foot). interested in building a percentage failure rate based on my selection, so for example, if i selected only person a i would want the failure rate (lets say on a card) to read 23% (i.e. (2+1)/(10+3) = 23%), however if i selected both person a and person b the failure rate should read 21% (i.e. (2+1+4+0)/(10+3+10+10)=21%). Any and all help would be much appreciated, thanks

 

 

Kicks.png

 

 

1 ACCEPTED SOLUTION

@Anonymous

 

Hi Dave,

 

Click the measure first, then change the format.Dynamic Percentage calculation based on Selection2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
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

4 REPLIES 4
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @Anonymous,

 

There are two options.

Option 1:

BySumx =
SUMX ( 'Table25', 'Table25'[Failed Left Foot] + 'Table25'[Failed Right Foot] )
    / SUMX (
        'Table25',
        'Table25'[Attempted Left Foot] + 'Table25'[Attempted Right Foot]
    )

Option 2:

BySum =
 ( SUM ( 'Table25'[Failed Left Foot] ) + SUM ( Table25[Failed Right Foot] ) )
    / ( SUM ( Table25[Attempted Left Foot] ) + SUM ( Table25[Attempted Right Foot] ) )

Finally, we can add them to a Card visual. A slicer will help to choose person.

 

These two formulas work under the context of 'Table25'[Person], so the result is dynamic.

Dynamic Percentage calculation based on Selection.jpg 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

Community Support Team _ Dale
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Hi Dale,

 

thank you for the response, thats works but can you confirm how you got the value in the card to be a percentage, as mine is showing as a decimal, i.e. 0.21. the option to change to percentage

 

under modelling - formatting - the percentage icon and Format options are greyed out (sorry cannot upload image as no option to do so?)

 

thanks,

dave

Anonymous
Not applicable

perc.png

 

 

 

@Anonymous

 

Hi Dave,

 

Click the measure first, then change the format.Dynamic Percentage calculation based on Selection2.jpg

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Best Regards!

Dale

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

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.