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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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 @ray_ux 

 

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]) ) )

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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