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

July 28 - August 9 | Final Round of the Power BI Dataviz World Championships. This is your chance. Learn more

Reply
lizzy
Helper I
Helper I

Dynamic Weighted Sum

I'm trying to create a dynamic weighted sum of different attributies of categories to get a total using user-adjustable parameters.
My component table looks something like this:

CategoriesValue1Value2
Cat10.30.4
Cat20.10.7
Cat30.60.3

Then I have two what-if parameters, Parameter1 and Parameter2.
I want to create a measure that allows me to get Value1*Parameter1+Value2*Parameter2 for each category.

I tried to use a calculated column, but apparently calculated columns don't work with what-if parameters. Is there a way to create a measure that looks like this?

CategoriesOutput
Cat10.3*Parameter1+0.4*Parameter2
Cat20.1*Parameter1+0.7*Parameter2
Cat30.6*Parameter1+0.3*Parameter2
1 ACCEPTED SOLUTION
Fowmy
Super User
Super User

@lizzy 

You can try this meaure:

Output
    = IF (
        HASONEVALUE ( table[Categories] ),
        SUM ( table[value1] ) * SELECTEDVALUE ( 'Parameter1'[value] )
            + SUM ( table[value2] ) * SELECTEDVALUE ( 'Parameter2'[value] )
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

View solution in original post

2 REPLIES 2
Fowmy
Super User
Super User

@lizzy 

You can try this meaure:

Output
    = IF (
        HASONEVALUE ( table[Categories] ),
        SUM ( table[value1] ) * SELECTEDVALUE ( 'Parameter1'[value] )
            + SUM ( table[value2] ) * SELECTEDVALUE ( 'Parameter2'[value] )
    )
Did I answer your question? Mark my post as a solution! and hit thumbs up


Subscribe and learn Power BI from these videos

Website LinkedIn PBI User Group

Perfect, thank you!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

Fabric Community Sticker Design Challenge Barcelona Carousel

Fabric Community Sticker Challenge - Barcelona 2026

If you love stickers, then you will definitely want to check out our community sticker challenge, Barcelona edition!

July Power BI Update Carousel

Power BI Monthly Update - July 2026

Check out the July 2026 Power BI update to learn about new features.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.