Don't miss your chance to take the Fabric Data Engineer (DP-700) exam on us!
Learn moreWe've captured the moments from FabCon & SQLCon that everyone is talking about, and we are bringing them to the community, live and on-demand. Starts on April 14th. Register now
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:
| Categories | Value1 | Value2 |
| Cat1 | 0.3 | 0.4 |
| Cat2 | 0.1 | 0.7 |
| Cat3 | 0.6 | 0.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?
| Categories | Output |
| Cat1 | 0.3*Parameter1+0.4*Parameter2 |
| Cat2 | 0.1*Parameter1+0.7*Parameter2 |
| Cat3 | 0.6*Parameter1+0.3*Parameter2 |
Solved! Go to Solution.
@lizzy
You can try this meaure:
Output
= IF (
HASONEVALUE ( table[Categories] ),
SUM ( table[value1] ) * SELECTEDVALUE ( 'Parameter1'[value] )
+ SUM ( table[value2] ) * SELECTEDVALUE ( 'Parameter2'[value] )
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
@lizzy
You can try this meaure:
Output
= IF (
HASONEVALUE ( table[Categories] ),
SUM ( table[value1] ) * SELECTEDVALUE ( 'Parameter1'[value] )
+ SUM ( table[value2] ) * SELECTEDVALUE ( 'Parameter2'[value] )
)
⭕ Subscribe and learn Power BI from these videos
⚪ Website ⚪ LinkedIn ⚪ PBI User Group
Perfect, thank you!
If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 53 | |
| 36 | |
| 33 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 73 | |
| 72 | |
| 38 | |
| 35 | |
| 26 |