cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
uperera7 Regular Visitor
Regular Visitor

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

Accepted Solutions
Moderator v-qiuyu-msft
Moderator

Re: Calculated column

Hi @uperera7,

 

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
ankitpatira Super Contributor
Super Contributor

Re: Calculated column

@uperera7 

 

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]))

uperera7 Regular Visitor
Regular Visitor

Re: Calculated column

@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?

Moderator v-qiuyu-msft
Moderator

Re: Calculated column

Hi @uperera7,

 

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

uperera7 Regular Visitor
Regular Visitor

Re: Calculated column

Dear @v-qiuyu-msft,

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

Helpful resources

Announcements
New Topics Started Badges Coming

New Topics Started Badges Coming

We're releasing new versions of the badge that everyone's talking about. ;) Check your inbox for notifications.

MBAS 2020

Save the new date (and location)!

Our business applications community is growing—so we needed a different venue, resulting in a new date and location. See you there!

Difinity Conference

Difinity Conference

The largest Power BI, Power Platform, and Data conference in New Zealand

Power Platform 2019 release wave 2 plan

Power Platform 2019 release wave 2 plan

Features releasing from October 2019 through March 2020

Top Solution Authors
Top Kudoed Authors (Last 30 Days)