<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Need Help Writing Formula with Multiple Parameters in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Need-Help-Writing-Formula-with-Multiple-Parameters/m-p/878785#M21763</link>
    <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;SWITCH(
    &amp;lt;expression&amp;gt;, // the value that each &amp;lt;value&amp;gt; will be evaluated against

    &amp;lt;value&amp;gt;, // to be matched against &amp;lt;expression&amp;gt;, if &amp;lt;value&amp;gt; = &amp;lt;expression&amp;gt; then perform &amp;lt;result&amp;gt;. This is practically the same as when an IF statement is true
    &amp;lt;result&amp;gt;, // the result if &amp;lt;value&amp;gt; = &amp;lt;expression&amp;gt;
   
    &amp;lt;value2&amp;gt;, 
    &amp;lt;result2&amp;gt;,

     …,

     &amp;lt;else&amp;gt;
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To evaluate if a slicer is selected you can use the&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/isfiltered-function-dax" target="_blank" rel="noopener"&gt;ISFILTERED()&lt;/A&gt;&amp;nbsp;formula.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// in an if statement
IF(
   ISFILTERED([column name of the slicer column]),
     &amp;lt;result&amp;gt;, // if the slicer is selected
     &amp;lt;result&amp;gt; // if the slicer is not selected
)
// in a switch
SWITCH(
     TRUE(),

     ISFILTERED([column name of the first slicer column]),
     &amp;lt;result&amp;gt;, // if the first slicer is selected

     ISFILTERED([column name of the second slicer column]),
     &amp;lt;result&amp;gt;, // if the second slicer is selected
     
     &amp;lt;result&amp;gt; // if no slicer is selected&amp;gt;
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To add values from a slicer in the &amp;lt;result&amp;gt; part of the formula you can use the &lt;A href="https://docs.microsoft.com/en-us/dax/selectedvalue-function" target="_blank" rel="noopener"&gt;SELECTEDVALUE()&lt;/A&gt; referencing the column used in each slicer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 18 Dec 2019 13:02:24 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2019-12-18T13:02:24Z</dc:date>
    <item>
      <title>Need Help Writing Formula with Multiple Parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-Help-Writing-Formula-with-Multiple-Parameters/m-p/876760#M21740</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;-Emmanuel&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 16 Dec 2019 20:54:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-Help-Writing-Formula-with-Multiple-Parameters/m-p/876760#M21740</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-16T20:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Need Help Writing Formula with Multiple Parameters</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Need-Help-Writing-Formula-with-Multiple-Parameters/m-p/878785#M21763</link>
      <description>&lt;P&gt;Hi&amp;nbsp;@Anonymous&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;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&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;SWITCH(
    &amp;lt;expression&amp;gt;, // the value that each &amp;lt;value&amp;gt; will be evaluated against

    &amp;lt;value&amp;gt;, // to be matched against &amp;lt;expression&amp;gt;, if &amp;lt;value&amp;gt; = &amp;lt;expression&amp;gt; then perform &amp;lt;result&amp;gt;. This is practically the same as when an IF statement is true
    &amp;lt;result&amp;gt;, // the result if &amp;lt;value&amp;gt; = &amp;lt;expression&amp;gt;
   
    &amp;lt;value2&amp;gt;, 
    &amp;lt;result2&amp;gt;,

     …,

     &amp;lt;else&amp;gt;
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To evaluate if a slicer is selected you can use the&amp;nbsp;&lt;A href="https://docs.microsoft.com/en-us/dax/isfiltered-function-dax" target="_blank" rel="noopener"&gt;ISFILTERED()&lt;/A&gt;&amp;nbsp;formula.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;// in an if statement
IF(
   ISFILTERED([column name of the slicer column]),
     &amp;lt;result&amp;gt;, // if the slicer is selected
     &amp;lt;result&amp;gt; // if the slicer is not selected
)
// in a switch
SWITCH(
     TRUE(),

     ISFILTERED([column name of the first slicer column]),
     &amp;lt;result&amp;gt;, // if the first slicer is selected

     ISFILTERED([column name of the second slicer column]),
     &amp;lt;result&amp;gt;, // if the second slicer is selected
     
     &amp;lt;result&amp;gt; // if no slicer is selected&amp;gt;
)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To add values from a slicer in the &amp;lt;result&amp;gt; part of the formula you can use the &lt;A href="https://docs.microsoft.com/en-us/dax/selectedvalue-function" target="_blank" rel="noopener"&gt;SELECTEDVALUE()&lt;/A&gt; referencing the column used in each slicer.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 18 Dec 2019 13:02:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Need-Help-Writing-Formula-with-Multiple-Parameters/m-p/878785#M21763</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2019-12-18T13:02:24Z</dc:date>
    </item>
  </channel>
</rss>

