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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
Anonymous
Not applicable

Calculated column

I want to fill 'Cumulative Ach Qty' column in 'Target Table' when 'Sales Table' is updated. Can anyone suggest me an expression for this?Untitled.jpg

1 ACCEPTED SOLUTION
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

In your scenario, you can create a calculated column like below:

 

Cumulative Ach Qty = SUMX(RELATEDTABLE('Sales Table'),'Sales Table'[Achieved Qty])

 

q1.PNG

 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

View solution in original post

4 REPLIES 4
v-qiuyu-msft
Community Support
Community Support

Hi @Anonymous,

 

In your scenario, you can create a calculated column like below:

 

Cumulative Ach Qty = SUMX(RELATEDTABLE('Sales Table'),'Sales Table'[Achieved Qty])

 

q1.PNG

 

 

Best Regards,
Qiuyun Yu

Community Support Team _ Qiuyun Yu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Anonymous
Not applicable

Dear @v-qiuyu-msft,

It worked. Thank you very much Qiuyun Yu. Smiley Happy

ankitpatira
Community Champion
Community Champion

@Anonymous 

 

1. Create relationship between two tables using ProductID.

2. Then under Target Table create calculated column using below DAX,

Cumulative Ach Qty = RELATED(SUM(SalesTable[AchievedQty]))

Anonymous
Not applicable

@ankitpatira

I created a relationship using ProductID and tried your expression. But it gave the following error.Untitled 3.jpg

Please refer the below statement I found from web.

"The RELATED function requires that a relationship exists between the current table and
the table with related information. You specify the column that contains the data that
you want, and the function follows an existing many-to-one relationship to fetch the
value from the specified column in the related table."

 

Therefore, I can get the 'Target' value from 'Target Table' to 'Sales Table' using RELATED function. But, I want to fill 'Cumulative Ach Qty' column in 'Target Table' when 'Sales Table' is updated. Is there any suggestion please?

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.