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

Score big with last-minute savings on the final tickets to FabCon Vienna. Secure your discount

Reply
Anonymous
Not applicable

Last value instead of average in total

I have a matrix in powerbi with 3 measures that are calculated as a weighted average. The total column is showing the average of the columns displayed but I want it to display the last value instead. Any idea how can I do that?

 

The formula I am using to calculate the KPI is:

SUMX(
table1,
table1[Average]*table1[weight])/
SUM(table1[weight])

Something like this

 q1q2q3q4Total nowTotal desired
KPI 158910810
KPI 261934.753
KPI 364624.52

 

Thank you!

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Anonymous ,

 

Let’s assume that your metric is called value

Value = SUMX(
table1,
table1[Average]*table1[weight])/
SUM(table1[weight])

 

You create the following measure using ISINSCOPE.

Final Value = IF(ISINSCOPE('table1'[q]),[Value],CALCULATE([Value],FILTER('table1',[q]="q4")))

14.png

 

Attached is the sample I created, there may be some discrepancies, you can refer to it.

 

Best Regards,

Stephen Tao

 

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 @Anonymous ,

 

Let’s assume that your metric is called value

Value = SUMX(
table1,
table1[Average]*table1[weight])/
SUM(table1[weight])

 

You create the following measure using ISINSCOPE.

Final Value = IF(ISINSCOPE('table1'[q]),[Value],CALCULATE([Value],FILTER('table1',[q]="q4")))

14.png

 

Attached is the sample I created, there may be some discrepancies, you can refer to it.

 

Best Regards,

Stephen Tao

 

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

 

Anonymous
Not applicable

Hello @Anonymous 

Thank you so much, it worked exactly as I wanted it.

thedatahiker
Microsoft Employee
Microsoft Employee

@Anonymous You can try something like this.

In this solution, you will need a date table. 

 

 

Var TableWeight =  SUM ( Table1[Weight] )
RETURN
CALCULATE (
DIVIDE ( Table1[Average] * Table1[Weight], TableWeight ),
LASTDATE( 'Date'[Date] )
)

 

 

 

 

Helpful resources

Announcements
August Power BI Update Carousel

Power BI Monthly Update - August 2025

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

August 2025 community update carousel

Fabric Community Update - August 2025

Find out what's new and trending in the Fabric community.