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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register now.

Reply
analystict
Helper I
Helper I

Sum of a measure filtered by two different columns.

Hi,

 

I've been trying to find a solution for this and the closest solution that I got to was using EARLIER() which did not serve the purpose due to the (slightly) complex situation.

 

I have a table called Affiliates which appears like so, and what I'm trying to calculate is the master result, which is for this instance, the income multiplied by 0.5. This master commission should only apply to the master affiliates like so:

 

 

Affiliate| Income | Master | Master Commission

John     | 800    | Bruce  | 0 (Not a master of anyone)

Dave     | 200    | Bruce  | 0 (Not a master of anyone)

Bruce    | 1000   | Adam   | 565 (800+200+130 multiplied by 0.5) (Master of John, Dave and Yves).

Adam     |  4000  |        | 500 (1000 multiplied by 0.5) (Master of Bruce)

Yves     |  130   | Bruce  | 0 (Not a master of anyone)

 

 

I'd appreciate some advice regarding on the calculation of this measure.

 

Thanks!

 

 

2 ACCEPTED SOLUTIONS
AlB
Community Champion
Community Champion

Hi @analystict

 

Try this for a new column on your table (Table1):

 

NewColumnMasterCommission =
VAR _CurrentAffiliate = Table1[Affiliate]
RETURN
    ( 1 / 2 )
        * CALCULATE (
            SUM ( Table1[Income] ),
            FILTER (
                Table1,
                Table1[Master] = _CurrentAffiliate
            )
        )

 

 

View solution in original post

v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @analystict,

 

If you'd like a measure, try this one.

Measure =
CALCULATE (
    SUM ( Table1[Income] ),
    FILTER ( ALL ( 'Table1' ), 'Table1'[Master] = MIN ( Table1[Affiliate] ) )
) * 1 / 2

Sum-of-a-measure-filtered-by-two-different-columns

 

 

Best Regards,

Community Support Team _ Dale
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

3 REPLIES 3
v-jiascu-msft
Microsoft Employee
Microsoft Employee

Hi @analystict,

 

If you'd like a measure, try this one.

Measure =
CALCULATE (
    SUM ( Table1[Income] ),
    FILTER ( ALL ( 'Table1' ), 'Table1'[Master] = MIN ( Table1[Affiliate] ) )
) * 1 / 2

Sum-of-a-measure-filtered-by-two-different-columns

 

 

Best Regards,

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

Did the trick, thank you 🙂

AlB
Community Champion
Community Champion

Hi @analystict

 

Try this for a new column on your table (Table1):

 

NewColumnMasterCommission =
VAR _CurrentAffiliate = Table1[Affiliate]
RETURN
    ( 1 / 2 )
        * CALCULATE (
            SUM ( Table1[Income] ),
            FILTER (
                Table1,
                Table1[Master] = _CurrentAffiliate
            )
        )

 

 

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

Find out what's new and trending in the Fabric community.