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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
owenmdavies
Frequent Visitor

Custom column/measure based on value in table

Hi

 

I have a table like this

Grid 1.PNG

The data for actual will be from another table and keyed on the Product/Colour

What is the best method to calculate the actual ?

 

Thanks in advance

 

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

Hi @owenmdavies,

 

If the target table only has one match record, I think lookupvalue should be simple to get result.

If it has multiple records can match the conditions, you can try to sumx function.

 

Sample:

Calculate column
Single= Lookupvalue(Target[Actual],Target[Product], Product[Product],Target[Color],Product[Color])
Total= SUMX(FILTER(ALL(Target),Target[Product]=EARLIER(Product[Product])&&Target[Color]=EARLIER(Product[Color])),[Actual])

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

1 REPLY 1
v-shex-msft
Community Support
Community Support

Hi @owenmdavies,

 

If the target table only has one match record, I think lookupvalue should be simple to get result.

If it has multiple records can match the conditions, you can try to sumx function.

 

Sample:

Calculate column
Single= Lookupvalue(Target[Actual],Target[Product], Product[Product],Target[Color],Product[Color])
Total= SUMX(FILTER(ALL(Target),Target[Product]=EARLIER(Product[Product])&&Target[Color]=EARLIER(Product[Color])),[Actual])

 

 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

Helpful resources

Announcements
PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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