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

Level up your Power BI skills this month - build one visual each week and tell better stories with data! Get started

Reply
walkersw
New Member

Unable to Limit Application of What If Parameter at Summary/Year Level

Hello,

 

I'm new to Power BI and working to leverage a What If Parameter(0-100%) to apply a factor to a subset of my Forecast data.  The DAX for my measure is as follows:

 

Adjusted Forecast = IF (MAX('Financials_8_31_22'[OpportunityName]) = "Opportunity One", SUM('Financials_8_31_22'[Forecast]) * '2022 Multiplier Value'[2022 Revenue Multiplier],   SUM('Financials_8_31_22'[Forecast]))
 
I only want to apply my What If parameter percentage(2022 Revenue Multiplier, 50%) to Opportunity One.  This seems to work when I add Opportunity Name to my table as a column; however, when I remove Opportunity name, the What If Parameter is applied to Opportunity One and Opportunity Two.  Can you tell me what I'm missing to have the logic applied as desired at the aggregate/year-level.  Thank you. 
What If Parameter set at 50% (Opp Name Added to Columns)
What if applied to Opportunity One Only
YearForecastAdjusted ForecastOpportunityName
2022$363,447$363,447Opportunity Two
2022$13,560,915.72$6,780,457.86Opportunity One
2023$491,741$491,741Opportunity Two
2023$24,821,919.65$12,410,959.83Opportunity One
    
What If Parameter set at 50% (Opp Name Removed from Columns)
What if applied to Opportunity One and Two.
YearForecastAdjusted ForecastDesired Adjusted Forecast
2022$13,924,362.72$6,962,181.36$7,143,905.00
2023$25,313,660.65$12,656,830.33$12,902,701.00
 
1 ACCEPTED SOLUTION

Hi @v-yalanwu-msft,

 

Thanks for the reply.   I was able to work through this with the following approach.  This provides me the ability to apply the What If Parameter to selected Opportunities and combine the selected Opportunity cost with the non-selected cost at the year/aggregate level.   

 

Measure for Total Cost

Total Cost = SUM(Financials[Forecast])

 

Measure for the Selected Opportunity Cost

Selected Opportunity Cost =
        VAR
                Opportunities = SUMX(Financials, Financials[Forecast] * 'Multiplier Value'[Net Revenue Multiplier])
        RETURN
        CALCULATE(
                Opportunities, ALLSELECTED(Opportunity[Name]))
 
Measure for the Non Selected Opportunity Cost
Non Selected Opportunity Cost =
CALCULATE(
        [Total Cost], EXCEPT (ALL (Opportunity[Name]),ALLSELECTED(Opportunity[Name])))
 
Measure for the Total Forecast
Total Forecast = [Selected Opportunity Cost] + [Non Selected Opportunity Cost]

View solution in original post

4 REPLIES 4
v-yalanwu-msft
Community Support
Community Support

Hi, @walkersw ;

Because measures are created based on row contexts, if you remove the [OpportunityName] column, the row level of [OpportunityName] is missing;
MAX('Financials_8_31_22'[OpportunityName]) in your formula can be imagined to be "Opportunity Two", because "Opportunity Two" >Opportunity One", so the first condition is not met, so the result is SUM('Financials_8_31_22'[Forecast]).
So the best way is to put [OpportunityName] on the value to distinguish OpportunityName.


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

Thank you, @v-yalanwu-msft .  Is there a way to apply my What If parameter to only one of the opportunities, while displaying the data at the year-level?  When I switch my visualizations to a year summary (line chart or table) the What If parameter is being applied to both Opportunities.  

Hi, @walkersw ;

Sorry I don't understand what you mean, can you have a scenario to illustrate it?


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

Hi @v-yalanwu-msft,

 

Thanks for the reply.   I was able to work through this with the following approach.  This provides me the ability to apply the What If Parameter to selected Opportunities and combine the selected Opportunity cost with the non-selected cost at the year/aggregate level.   

 

Measure for Total Cost

Total Cost = SUM(Financials[Forecast])

 

Measure for the Selected Opportunity Cost

Selected Opportunity Cost =
        VAR
                Opportunities = SUMX(Financials, Financials[Forecast] * 'Multiplier Value'[Net Revenue Multiplier])
        RETURN
        CALCULATE(
                Opportunities, ALLSELECTED(Opportunity[Name]))
 
Measure for the Non Selected Opportunity Cost
Non Selected Opportunity Cost =
CALCULATE(
        [Total Cost], EXCEPT (ALL (Opportunity[Name]),ALLSELECTED(Opportunity[Name])))
 
Measure for the Total Forecast
Total Forecast = [Selected Opportunity Cost] + [Non Selected Opportunity Cost]

Helpful resources

Announcements
Fabric SQL PBI Data Days

Data Days 2026 coming soon!

Sign up to receive a private message when registration opens and key events begin.

New to Fabric survey Carousel

New to Fabric Survey

If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.

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.