cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
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

Highlighted
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
Exclusive LIVE Community Event #3 – Ask Arun Anything

Exclusive LIVE Community Event #3 – Ask Arun Anything

Join us in the third Triple A event!

Meet the 2020 Season 1 Power BI Super Users!

Meet the 2020 Season 1 Power BI Super Users!

It’s the start of a new Super User season! Learn all about the new Super Users and brand-new tiered recognition system.

January 2020 Community Highlights

January 2020 Community Highlights

Make sure you didn't miss any of the things that happened in the community in January!

Difinity Conference

Difinity Conference

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

Top Solution Authors
Top Kudoed Authors