简体   繁体   中英

how to translate Sum product formula in power bi

I have this data table, where i want to calculate the final score based on CI value my excel formula is =SUMPRODUCT(--(H4:H20>0),H4:H20,E4:E20)/SUMIF(H4:H20,">0",E4:E20)

在此处输入图像描述

The formula you are looking for is

final score = 
DIVIDE(
    SUMX(
        'Table',
        'Table'[CI] * 'Table'[score]
    ),
    CALCULATE(
        SUM('Table'[CI]),
        'Table'[score] > 0
    )
)

在此处输入图像描述

You can test this:

Your_Measure =
ROUND (
    DIVIDE (
        SUMX ( SumProduct, IF ( SumProduct[score] > 0, [score] * [CI] ) ),
        SUMX ( SumProduct, IF ( [score] > 0, [CI] ) )
    ),
    6
)

Result It produces:

HGHGGH

You can follow the link to find help.

The solution in the link is for PowerQuery

https://www.myonlinetraininghub.com/excel-forum/power-query/countifs-or-sumproduct-in-power-query-or-dax

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