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! Request now

Reply
dajackson
New Member

Calculate dynamic percentage from 2 fields in a table that will work in visuals when filtering

Hi all,

 

I have a calculated column that is meant to show the percentage performance against the target based on two columns: target and actual. I have hundreds of rows for each country and I want to be able to use the performance column to use the total target and actual for each country (and for other fields). What formula should I be using as presently it looks like this:

 

Performance = Divide((vPSTFlatReport[Actual]),(vPSTFlatReport[Target]))
 
And this is a matrix visualisation showing the result:

 

CountryTargetActualAverage of Performance
Ethiopia25,076,48210,201,2687%
Kenya7,510,6191,487,022118%
Malawi62,01794,231294%
Mozambique380,912313,548166%
Republic of Sudan1,259,200295,1166%
Tanzania807,768679,097240%
Uganda442,556411,35083%
Zambia3,751,0371,505,90493%
Zimbabwe2,744,798513%

 

I have a number of rows where the actual is blank, what I want the performance column to show is the actuals total for any filtered data set divided by the target for that smae filtered dataset. The example above shows this for country but I have other fields that I would like this table to work for. 

 

Thank you

2 REPLIES 2
TeigeGao
Solution Sage
Solution Sage

Hi @dajackson ,

Actually, in your scenario, you just need to use the CALCULATE(Divide((vPSTFlatReport[Actual]),(vPSTFlatReport[Target]))) to get the result, it will consider all filters on the dataset.

Best Regards,

Teige

@TeigeGao 

 

Thank you very much for the suggestion.

 

This formula returns a #ERROR and gives me the warning:

 

"A single value for column 'Actual' in table 'vPSTFlatReport' cannot be determined. This can happen when a measure formula refers to a column that contains many values without specifying an aggregation such as min, max, count, or sum to get a single result."

 

Best

D

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

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!

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