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

Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes! Register now.

Reply
pr1ngl3
Regular Visitor

Calculate calculated fields by row

Afternoon - hoping someone can put me out of my misery....

pr1ngl3_3-1678455741854.png

 

Using the above as an example...

The following Tables have a relationship via a Customer Mapping table

Term is a calculated column from Contracts (basic datediff from Today() to term end date, in months)

GL has a calculated column to determine the last posting date of an invoice  

LastPostingDate = calculate(max(GL[Posting Date (bins)]),ALLEXCEPT(GL,GL[Customer Map]), GL[Posting Date] <= today())

Last Invoice is a measure to sum the value, filtering so the posting date is the same as the last posting date

LastInvoice = calculate(sum(GL[Amount]),filter(GL,GL[Posting Date (bins)] = GL[LastPostingDate]))

Remaining Revenue is a measure to multiply the 2 values

Remaining Revenue = calculate([LastInvoice] * MAX('Contracts'[Months Remaining]))

All this is working accurately per line (by customer) however, the Total (as expected) is also calulating in this was, summing the Last Invoice and multiplying by the MAX of the term remaining.  - highlighted in RED. Whereas, I need to calculate each line individually and sum that, highlighted in Green.

 

Any ideas?

 

Thanks in advance

1 ACCEPTED SOLUTION
DimaMD
Solution Sage
Solution Sage

Hi @pr1ngl3 Try it maesure

IF( HASONEVALUE('table'[Customer]),
 [Remaining Revenue],
 SUMX( VALUES('table'[Customer]),
 [Remaining Revenue]))

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

View solution in original post

2 REPLIES 2
DimaMD
Solution Sage
Solution Sage

Hi @pr1ngl3 Try it maesure

IF( HASONEVALUE('table'[Customer]),
 [Remaining Revenue],
 SUMX( VALUES('table'[Customer]),
 [Remaining Revenue]))

__________________________________________

Thank you for your like and decision

__________________________________________

Greetings from Ukraine

To help me grow PayPal: embirddima@gmail.com

Thank you so much!! been struggling with this for a while.

Such a quick reply too 😁

Helpful resources

Announcements
September Power BI Update Carousel

Power BI Monthly Update - September 2025

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

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.