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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
mikesfagan
New Member

Use values from other rows to execute a custom calculation

I'm trying to write a custom calculation in the Total Protein advancedcalcs field, where i can use the Enteredvalue value of the Purity result to calculate a new Protein result fo reach unique keyid1 value.  Bascially, subtracting the Purity value from the Total

Protein value.  What's the best way to do this?

Capture.PNG

 

 

 

1 ACCEPTED SOLUTION
v-lid-msft
Community Support
Community Support

Hi @mikesfagan ,

 

We can use the following measure to meet your requirement:

 

advancedcal = 
AVERAGEX (
    FILTER ( ALL ( 'Table' ), [keyid1] IN FILTERS ( 'Table'[keyid1] ) ),
    [enteredvalue]
)

 

8.PNG

 

 

BTW, pbix as attached.

 

Best regards,

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

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

2 REPLIES 2
v-lid-msft
Community Support
Community Support

Hi @mikesfagan ,

 

How about the result after you follow the suggestions mentioned in my original post?

 

Best regards,

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

Community Support Team _ Dong Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
v-lid-msft
Community Support
Community Support

Hi @mikesfagan ,

 

We can use the following measure to meet your requirement:

 

advancedcal = 
AVERAGEX (
    FILTER ( ALL ( 'Table' ), [keyid1] IN FILTERS ( 'Table'[keyid1] ) ),
    [enteredvalue]
)

 

8.PNG

 

 

BTW, pbix as attached.

 

Best regards,

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

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

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

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.