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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Gerardfaba
Regular Visitor

Assigning right values to the right row

I currently have a simplified input sheet with only 3 columns ("Entity", "Value" and "Counterparty"). Additionally, I have created a measure called "Target Value".

Now I need a formula that does the following:

  1. For entities with a value under the "Value" column, calculate the "Adjustment" (i.e., Target Value - Value).
  2. For entities that are listed as counterparties, they get the adjustment of the Entity's row with inverse value. For example, if Entity 1 had an Adjustment of 10, and Entity 2 appears in the Counterparty column, Entity 2 would get assigned an adjustment of -10.

Also, the formula should allow for aggregation of several adjustments (for example, Entity 2 being counterparty twice for 2 different entities, so 2 Adjustments will be aggregated).

See example below. 

Gerardfaba_0-1727180799192.png

 



Thanks in advance!

3 REPLIES 3
Omid_Motamedise
Super User
Super User

Do you whant to do this by M or DAX?

If my answer helped solve your issue, please consider marking it as the accepted solution. It helps others in the community find answers faster—and keeps the community growing stronger!
You can also check out my YouTube channel for tutorials, tips, and real-world solutions in Power Query with the following link
https://youtube.com/@omidbi?si=96Bo-ZsSwOx0Z36h

I would say DAX

Anonymous
Not applicable

Hi @Gerardfaba 

Based on your description, you have the Target Value measure,what is it about, and can you provide some more sample data and the output you want so that can provide more suggestion for you, too little information is provided on the photos.

 

Best Regards!

Yolo Zhu

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.

Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

Top Solution Authors