<?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: Using Parameters in Dax calculation in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Parameters-in-Dax-calculation/m-p/4025416#M158908</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;My requirement differs slightly: depending on the selected category, the output should display "Late" or "Early" for each value within that chosen category.&lt;BR /&gt;Ex&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
    <pubDate>Thu, 04 Jul 2024 15:22:49 GMT</pubDate>
    <dc:creator>Praj8050</dc:creator>
    <dc:date>2024-07-04T15:22:49Z</dc:date>
    <item>
      <title>Using Parameters in Dax calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Parameters-in-Dax-calculation/m-p/4024943#M158884</link>
      <description>&lt;P&gt;Hello Community,&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I am facing a challenge while trying to extract specific text from multiple category fields using DAX calculations&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Here's the situation:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;I have a table with the following structure:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My goal is to extract the text "Late" or "Early" from any of the categories (Category1, Category2, Category3, or Category4). I can successfully do this with individual column using a direct formula such as:&lt;/P&gt;&lt;P&gt;DAX&lt;BR /&gt;= IF(CONTAINSSTRING([Category1], "Late"), "Late", "Early")&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;However, I want to make this dynamic by using a parameter so that I can choose any category to extract the text from. For this purpose, I created a parameter (named `Parameter Selection`) for Category1, Category2, Category3, and Category4. My intention is to use the following formula to determine the text based on the selected category:&lt;/P&gt;&lt;P&gt;DAX&lt;BR /&gt;= IF(CONTAINSSTRING(['Parameter Selection`], "Late"), "Late", "Early")&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Unfortunately, when I use this formula with the parameter, I encounter the following error:&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;img /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Questions:&lt;BR /&gt;1. How can I resolve the error related to field relationships?&lt;BR /&gt;2. Is there a specific way to set up parameters in DAX calculations to avoid such issues?&lt;BR /&gt;3. What is the best approach to dynamically extract text like "Late" or "Early" from selected categories using parameters?&lt;/P&gt;&lt;P&gt;Any guidance or suggestions to solve this problem would be greatly appreciated.&lt;/P&gt;&lt;P&gt;Thank you for your help!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 10:51:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Parameters-in-Dax-calculation/m-p/4024943#M158884</guid>
      <dc:creator>Praj8050</dc:creator>
      <dc:date>2024-07-04T10:51:52Z</dc:date>
    </item>
    <item>
      <title>Re: Using Parameters in Dax calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Parameters-in-Dax-calculation/m-p/4025211#M158892</link>
      <description>&lt;P&gt;Hi first prepare measures for each category like the following&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Create one parameter table&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;use the same parameter as slicer and part of the output table&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If the above meets your requirement then pls accept the same as your solution.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 13:10:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Parameters-in-Dax-calculation/m-p/4025211#M158892</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-07-04T13:10:06Z</dc:date>
    </item>
    <item>
      <title>Re: Using Parameters in Dax calculation</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Parameters-in-Dax-calculation/m-p/4025416#M158908</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;My requirement differs slightly: depending on the selected category, the output should display "Late" or "Early" for each value within that chosen category.&lt;BR /&gt;Ex&lt;BR /&gt;&lt;BR /&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Jul 2024 15:22:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Parameters-in-Dax-calculation/m-p/4025416#M158908</guid>
      <dc:creator>Praj8050</dc:creator>
      <dc:date>2024-07-04T15:22:49Z</dc:date>
    </item>
  </channel>
</rss>

