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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Request now

Reply
JLMLV00
Frequent Visitor

Measure instead of calculated columns

Hi, 
I want to calculate de difference between invoiced amount (€) and a recalculated amount. I get it done with calculated columns in my FactInvoices table but instead i would rather use a measure if this is possible.  
I want for each invoice row the difference between invoiced and recalculated amount using these tables.  
Some of the clients get at the end of a period a recalculated price, this price is based on another pricelist in pricingsmethod table with conditions such as product ID, between start and end date and invoiced units. 
can i get this done without using calculated columns? 
In table invoices is an example of the invoices the columheaders with red text colour is expected output (and not a part of original table)

RecalculationTable            
Client id Start dateEnd dateProduct IDStarting amount (units)Ending amount (units)discount Listprice     
A1-1-202231-12-20231001000001,53     
B1-1-202231-12-202315035000,52     
B1-1-202231-12-20231535001000012     
             
             
PricingTable            
Date

Product ID

Pricingmethod1Pricingmethod2Pricingmethod3        
10-5-2023

15

2,833,2        
23-3-2023152,52,852,65        
             
InvoiceTable            
DateinvoicenumerClient product idTotal amount unitsPriceTotal €Pricingmetod invoicedRecalculation methodPrice recalculatedRecalculated discountRecalculated total €Difference
23-3-2023100A105002,5                            1.250,00132,651,5         575,00       -675,00
10-5-2023102B1510002,8                            2.800,001230,5     2.500,00       -300,00
23-3-2023101B1536002,5                            9.000,00122,851     6.660,00   -2.340,00
10-5-2023103A256002,8                            1.680,001None-   
2 REPLIES 2
amitchandak
Super User
Super User

@JLMLV00 , You have force that calculation at row level in meausre

 

Example

Sumx(Table,

var _col = <Column calc>

return <More calc> )

 

or

Power BI Dax Measure- Allocate data between Range: https://youtu.be/O653vwLTUzM

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 a lot, 
hope you can help me out with this one, 
Client A has more than one rows in the recalculationtable 
from 1-1-23 till 30-6-23 their recalculated pricing method is 2 
from 1-7-23 till 31-12-23 pricing method is 3 
with Sumx <=max(date) etc.  the invoicerows from 1-1-23 till 30-6-23 wont show their recalculation pricing, because he's gonna use the max dates of the clients, when used MIN() the invoice rows after 30-6-23 wont show up. 
SUMX(Filter(Invoicetable,Invoicetable[date]>=Max(Recalculationtable[startdate]&&Invoicetable[date]<=Max(Recalculationtable[Enddate]), [Listprice])

Helpful resources

Announcements
November Power BI Update Carousel

Power BI Monthly Update - November 2025

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

Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

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.

Top Solution Authors