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

We'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

Reply
Anonymous
Not applicable

Need Help Writing Formula with Multiple Parameters

Hello,

 

I'm relatively new to Power BI and would appreciate some help with a calculation. I have around 12 parameters and have created individual measures for each one. The objective is to create a chart that dispalys an average price of a single field as long as no parameters are filled in. However, when the any of the parameters are filled in I would like for the measure to adjust by calcualting the current price by the parameters that are filled in. I am essentially trying to create one measure that is calcualted using all the parameters and therefore would adjust if/when any parameters are populated. I've tried an IF statement however I am limited on the number of logic test I can record. Can anyone provide some insight how I can write the calculation for this? Any help would greatly appreciated.

 

-Emmanuel 

1 REPLY 1
Anonymous
Not applicable

Hi @Anonymous ,

 

if you want to have a calculation to select between multiple slicers or what-if parameters you can use the SWICH formula. It performs basically the same function as nested if statements

 

 

 

SWITCH(
    <expression>, // the value that each <value> will be evaluated against

    <value>, // to be matched against <expression>, if <value> = <expression> then perform <result>. This is practically the same as when an IF statement is true
    <result>, // the result if <value> = <expression>
   
    <value2>, 
    <result2>,

     …,

     <else>
)

 

 

To evaluate if a slicer is selected you can use the ISFILTERED() formula. 

 

// in an if statement
IF(
   ISFILTERED([column name of the slicer column]),
     <result>, // if the slicer is selected
     <result> // if the slicer is not selected
)
// in a switch
SWITCH(
     TRUE(),

     ISFILTERED([column name of the first slicer column]),
     <result>, // if the first slicer is selected

     ISFILTERED([column name of the second slicer column]),
     <result>, // if the second slicer is selected
     
     <result> // if no slicer is selected>
)

 

 

To add values from a slicer in the <result> part of the formula you can use the SELECTEDVALUE() referencing the column used in each slicer. 

 

Helpful resources

Announcements
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.

Join our Fabric User Panel

Join our Fabric User Panel

Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.

March Power BI Update Carousel

Power BI Community Update - March 2026

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