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
Anonymous
Not applicable

Data on Date Range and Customer

Hi , i am trying to add to my transaction table , the price from the price list.

 

transactiontbl:

Customer, Date, Amount

 

PriceListtbl:

[From Date],[To Date],[Customer],[Price]

 

please help me, to add the price to transactiontbl

1 ACCEPTED SOLUTION
Anonymous
Not applicable

@Anonymous

 

Implement the below DAX and let me know if this is what you're looking for?

 

Create a new column applying the below DAX.

Price=
         CALCULATE( AVERAGE( PriceListtbl[Price] ),
                              FILTER( PriceListtbl,
                                          PriceListtbl[FromDate] <= ( transactiontbl[Date] )
                                          && PriceListtbl[ToDate] >= ( transactiontbl[Date] )
                                          && PriceListtbl[Customer] = ( transactiontbl[Customer] )
                                          )
                            )

 

Then taking it a step further to work out the Amount * Price per Customer, ignoring the date (although the Price is reflected by Date period in the first calculation) - see below:

Create a new table apply the below DAX:

tPRICE =
          GROUPBY( transactiontbl, transactiontbl[Customer],
                           "PRICEPRICE", SUMX( CURRENTGROUP(), transactiontbl[cPrice] * transactiontbl[Amount] )
                          )

 

Note: you can rename the column/table to anything you want.

View solution in original post

2 REPLIES 2
Anonymous
Not applicable

@Anonymous

 

Implement the below DAX and let me know if this is what you're looking for?

 

Create a new column applying the below DAX.

Price=
         CALCULATE( AVERAGE( PriceListtbl[Price] ),
                              FILTER( PriceListtbl,
                                          PriceListtbl[FromDate] <= ( transactiontbl[Date] )
                                          && PriceListtbl[ToDate] >= ( transactiontbl[Date] )
                                          && PriceListtbl[Customer] = ( transactiontbl[Customer] )
                                          )
                            )

 

Then taking it a step further to work out the Amount * Price per Customer, ignoring the date (although the Price is reflected by Date period in the first calculation) - see below:

Create a new table apply the below DAX:

tPRICE =
          GROUPBY( transactiontbl, transactiontbl[Customer],
                           "PRICEPRICE", SUMX( CURRENTGROUP(), transactiontbl[cPrice] * transactiontbl[Amount] )
                          )

 

Note: you can rename the column/table to anything you want.

Anonymous
Not applicable

Thank you, 

Is there an option to do it in power query?

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