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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
Jers19
New Member

Calculated column

Hello,

I have two tables (without relation)

  • table of sales with two columns
    • ID
    • date of sales
  • table of prices with four columns
    • ID
    • validity start date
    • expiry date
    • price

I'd like to add a calculated column in the "sales" table with the price that was valid.

I try with "filter" but I have a result only when the sales date is egal to the validity start date 😞

Thank you for your help

1 ACCEPTED SOLUTION
tamerj1
Super User
Super User

Hi @Jers19 

please try

Price =
MAXX (
FILTER (
Price,
Price[ID] = Sales[ID]
&& Price[Validity Start Date] <= Sales[Date of Sales]
&& Price[Expiry Date] >= Sales[Date of Sales]
),
Price[Price]
)

View solution in original post

2 REPLIES 2
tamerj1
Super User
Super User

Hi @Jers19 

please try

Price =
MAXX (
FILTER (
Price,
Price[ID] = Sales[ID]
&& Price[Validity Start Date] <= Sales[Date of Sales]
&& Price[Expiry Date] >= Sales[Date of Sales]
),
Price[Price]
)

Hello @tamerj1 

Thank you so much.  It works.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

November Power BI Update Carousel

Power BI Monthly Update - November 2025

Check out the November 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.