简体   繁体   中英

Power BI sumif function in different table has a many to many relationship

I need a function to calculation a percentage based on two values in two different tables that has many to many relationship in power BI DAX expression.

在此处输入图片说明

I assume your relations are ok, you did not give this info. I hope based on my example you can manage:

%Order = 
    var orderId = 'table'[orderID]
    var orderTotal = CALCULATE(SUM('table'[ItemValue]); FILTER('table';orderId =  'table'[orderID]))
return 'table'[ItemValue]/orderTotal

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM