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

Related tables and forcasting

Hello all,

 

I have 2 tables which are related in a Many to 1 by Contract name.   

 

Sales (Many)  = A list of sales to multiple customers with these important columns

Sales numberContract nameProductPrice
1Customer 1Oranges10
2Customer 1Apples50
3Customer 2Oranges2
4Customer 1Oranges34
5Customer 2Oranges56
6Customer 1Apples78
7Customer 1Oranges70
8Customer 1Apples30
9Customer 2Apples10

 

From that I have metrics that work out daily average sales both in volume and cost  (there's a date field which I don't think is important for my question)

 

ContractDate (to 1) = is a simple 3 column table like this

 

Contract NameDate contract endsDays until contract ends
Customer 131/05/2022396
Customer 231/12/2021245
Customer 314/09/2021137
Customer 428/06/202159
Customer 522/05/202122

 

Each customer name only appears once in this list.

 

 

The outcome I want to get to is to be able to group by customer or product name across customers, take my daily average for that product and multiply it by the Days until contract ends value for that customer.  That will let me forecast how many sales and their value until the end of the contract.

 

The trouble I run into is getting each customer's Days until contract ends value into a metric where I can use it.

 

I hope that makes sense and thanks for any help!

4 REPLIES 4
Anonymous
Not applicable

Hi  @Anonymous  ,

Here are the steps you can follow:

1. Create calculated column.

Column = RELATED(Table2[Days until contract ends])
Column 2 = 'Table'[Price]*'Table'[Column]

v-yangliu-msft_0-1620112529231.png

2. Create calculated table.

Sales =
SUMMARIZE('Table','Table'[Contract Name],'Table'[Product],"sales",SUM('Table'[Column 2]))

3. Result:

v-yangliu-msft_1-1620112529234.png

 

 

Best Regards,

Liu Yang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Jihwan_Kim
Super User
Super User

Hi, @Anonymous 

I am not sure if I understood your question correctly, but please try the below whether it is what you are looking for.

 

Forecast sales =
SUMX(Sales, Sales[Price] * RELATED(ContractDate[Days until contract ends]))
 

Hi, My name is Jihwan Kim.


If this post helps, then please consider accept it as the solution to help other members find it faster, and give a big thumbs up.


Linkedin: linkedin.com/in/jihwankim1975/

Twitter: twitter.com/Jihwan_JHKIM


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.
Anonymous
Not applicable

@Jihwan_Kim 

 

Yeah that's roughly how simple I thought it would be.  I thought it would be

Daily_Average * RELATED(ContractDate[Days until contract ends])

 

But the measures simply won't allow me to add the Days Until contract ends field in there which is why I am stuck.  I can use it in column calculations, but not measures.   Any ideas on what might be happening?

Hi, @Anonymous 

Thank you for your feedback.

I am not sure how your data model looks like, but please check the relationship between the two tables.

Or, if it is OK with you, please share your sample pbix file's link here, then I can try to look into it to come up with a more accurate measure.

 

Thanks.


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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
Top Kudoed Authors