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

Compete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.

Reply
mvelasquez1970
Regular Visitor

Calculate a Measure based on a referenced column from another column in same table

Hi,
I've been trying to figure out how to approach this situation. I have a table like the one here:

Capture.PNG

I need a measure (Measure) that calculates the sum of TD based on the MidPoint Column refereferenced by EndPoint Column. So, if I choose EndPoint = Point A it sould return 8 as the sum of 4+3+1 where Midpoint = EndPoint = Point A. The problem is that when I select (filter) EndPoint = Point A, it filters out the rows where MidPoint = Point A, so what I get is 0.

 

Please help with this.
@amitchandak @Ashish_Mathur @Rayizer 

 

Thank you!

3 REPLIES 3
Ashish_Mathur
Super User
Super User

Hi,

In the Query Editor, select te last 2 columns, right click and select Unpivot Other columns.  Create a slicer of Attribute and select Midpoint.  Create another slicer of Value and select Point A.  Write this measure

Measure = sum(Data[TD])

Hope this helps.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
amitchandak
Super User
Super User

@mvelasquez1970 , Try a measure like

 

calculate(sum(Table[TD]), filter(allselected(Table), Table[Mid Point] = max(Table[end Point]) ) )

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

Thanks,
It partially works. When I use a table it shows the correct result for each EndPoint. However, when I select an EndPoint from a slicer it returns 0...

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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

Top Solution Authors