Forum Discussion

justivan's avatar
justivan
Icon for Helper II rankHelper II
5 years ago
Solved

Multiply 2 Measures by Row

I have 2 measures that determines the Total Cost and the Payout %. Total Cost is straight forward as to Payout%, the value is determined by which Tier is achieved already. If Tier 1 is achieve corres...
  • v-yingjl's avatar
    5 years ago

    Hi justivan ,

    Basically it looks like a wrong total issue, you can refer this article:

    https://community.powerbi.com/t5/Quick-Measures-Gallery/Measure-Totals-The-Final-Word/m-p/547907 

     

    The EST measute would be like this:

     

    Est. Payout Value =
    VAR tab =
        ADDCOLUMNS (
            'Table',
            "Total cost",
                [T1] + [T2] + [T3] + [T4],
            "Payout %",
                VAR vT1 =
                    MINX ( 'Table', [Payout1] )
                VAR vT2 =
                    MINX ( 'Table', [Payout2] )
                VAR vT3 =
                    MINX ( 'Table', [Payout3] )
                VAR vT4 =
                    MINX ( 'Table', [Payout4] )
                RETURN
                    SWITCH (
                        TRUE (),
                        [Tier 1 %] < 1, 0,
                        [Tier 1 %] >= 1
                            && OR ( [Tier 2 %] = "N/A", [Tier 2 %] < "1" ), vT1,
                        [Tier 2 %] >= "1"
                            && OR ( [Tier 3 %] = "N/A", [Tier 3 %] < "1" ), vT2,
                        [Tier 3 %] >= "1"
                            && OR ( [Tier 4 %] = "N/A", [Tier 4 %] < "1" ), vT3,
                        [Tier 4 %] >= "1", vT4
                    )
        )
    VAR tb =
        ADDCOLUMNS ( tab, "est", [Total cost] * [Payout %] )
    RETURN
        SUMX ( tb, [est] )
    

     

    You need to add your previous measure's formula into a variable table as a 'fact' column to use the context to calculate.

     

    Best Regards,
    Community Support Team _ Yingjie Li
    If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.