<?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: How to use USERELATIONSHIP with multiple Criteria to switch dates, when meeting the Criteria in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413195#M129080</link>
    <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="602415" data-lia-user-login="Madhu155154" class="lia-mention lia-mention-user"&gt;Madhu155154&lt;/a&gt;&amp;nbsp;, where are you going to use your measure?&amp;nbsp;&lt;/P&gt;&lt;P&gt;General approach is to use IF conditions along with CALCULATE and&amp;nbsp;&lt;SPAN&gt;USERELATIONSHIP.&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 04 Sep 2023 06:47:13 GMT</pubDate>
    <dc:creator>ERD</dc:creator>
    <dc:date>2023-09-04T06:47:13Z</dc:date>
    <item>
      <title>How to use USERELATIONSHIP with multiple Criteria to switch dates, when meeting the Criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413175#M129078</link>
      <description>&lt;P&gt;&amp;nbsp;Any suggestion on how to achieve the below requirements:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I&amp;nbsp; have&amp;nbsp;two tables,&amp;nbsp; one with 4 columns and another one is a calendar table&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Columns -&amp;gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Created Date:&lt;/P&gt;&lt;P&gt;Loan Amount:&lt;/P&gt;&lt;P&gt;Approved date:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Status: "Pending", " Under-Process", "Approved".&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have created a relationship between the Calender table and the main table :&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;* active relation: created date&amp;nbsp; and Calendar date&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;* inactive relation: approved date and calendar date&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to sum up the loan amount when I use the date slicer ( date column from calendar table ) -&amp;gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;for the status of Approved, it needs to use the Approved date column and for another status it needs to use the Created date&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;</description>
      <pubDate>Mon, 04 Sep 2023 06:27:32 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413175#M129078</guid>
      <dc:creator>Madhu155154</dc:creator>
      <dc:date>2023-09-04T06:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to use USERELATIONSHIP with multiple Criteria to switch dates, when meeting the Criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413195#M129080</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="602415" data-lia-user-login="Madhu155154" class="lia-mention lia-mention-user"&gt;Madhu155154&lt;/a&gt;&amp;nbsp;, where are you going to use your measure?&amp;nbsp;&lt;/P&gt;&lt;P&gt;General approach is to use IF conditions along with CALCULATE and&amp;nbsp;&lt;SPAN&gt;USERELATIONSHIP.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 06:47:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413195#M129080</guid>
      <dc:creator>ERD</dc:creator>
      <dc:date>2023-09-04T06:47:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to use USERELATIONSHIP with multiple Criteria to switch dates, when meeting the Criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413222#M129083</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="602415" data-lia-user-login="Madhu155154" class="lia-mention lia-mention-user"&gt;Madhu155154&lt;/a&gt;&amp;nbsp; hi , try it measure&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Amount_ApprovedDate = CALCULATE( SUM('table1'[Loan Amount]), USERELATIONSHIP(dates[Date],table1[Approved date]), 'table1'[Status:] = "Approved" )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 07:05:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413222#M129083</guid>
      <dc:creator>DimaMD</dc:creator>
      <dc:date>2023-09-04T07:05:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to use USERELATIONSHIP with multiple Criteria to switch dates, when meeting the Criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413446#M129095</link>
      <description>&lt;P&gt;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="312820" data-lia-user-login="DimaMD" class="lia-mention lia-mention-user"&gt;DimaMD&lt;/a&gt;&amp;nbsp;, Thank you answering for the question,&lt;BR /&gt;&lt;BR /&gt;But I am getting Static Data, I want it to be dynamic,&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;Can't we use&amp;nbsp;userelation&amp;nbsp; function to switch the dates for specific Cretira&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;A href="https://novofin-my.sharepoint.com/:u:/g/personal/madhu_k_finplex_in/Ee99xfICqYdHiDIeXIFxwbkBln74QZ3R1kGb5mIwHaQDRQ?e=ss6LUv" target="_blank"&gt;Test File data userelation.pbix&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 09:01:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413446#M129095</guid>
      <dc:creator>Madhu155154</dc:creator>
      <dc:date>2023-09-04T09:01:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to use USERELATIONSHIP with multiple Criteria to switch dates, when meeting the Criteria</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413469#M129096</link>
      <description>&lt;P&gt;To achieve your requirements of using the `USERELATIONSHIP` function with multiple criteria to switch dates based on the status column, you can create a DAX measure that sums up the loan amount while considering the relationship between the calendar table and the main table. Here's a step-by-step guide on how to do this:&lt;/P&gt;&lt;P&gt;1. Create a new DAX measure. In Power BI, you can do this by selecting "Modeling" from the top menu and then clicking "New Measure."&lt;/P&gt;&lt;P&gt;2. Use the `SUMX` function to iterate through the rows of your main table and calculate the sum of the loan amount based on your conditions. Here's a sample DAX formula:&lt;/P&gt;&lt;P&gt;```DAX&lt;BR /&gt;LoanAmountSum =&lt;BR /&gt;SUMX(&lt;BR /&gt;MainTable,&lt;BR /&gt;IF(&lt;BR /&gt;MainTable[Status] = "Approved",&lt;BR /&gt;CALCULATE(SUM(MainTable[Loan Amount]), USERELATIONSHIP(MainTable[Approved Date], Calendar[Date])),&lt;BR /&gt;CALCULATE(SUM(MainTable[Loan Amount]), USERELATIONSHIP(MainTable[Created Date], Calendar[Date]))&lt;BR /&gt;)&lt;BR /&gt;)&lt;BR /&gt;```&lt;/P&gt;&lt;P&gt;In this formula:&lt;/P&gt;&lt;P&gt;- `SUMX` iterates through each row of the MainTable.&lt;BR /&gt;- The `IF` statement checks the status column in each row. If the status is "Approved," it uses the `USERELATIONSHIP` function to establish the inactive relationship with the "Approved Date" and Calendar date. Otherwise, it uses the "Created Date" and Calendar date.&lt;BR /&gt;- `CALCULATE(SUM(MainTable[Loan Amount]), ...)` calculates the sum of the loan amount based on the appropriate relationship.&lt;/P&gt;&lt;P&gt;3. Once you've created the measure, you can add it to your visuals, and it will dynamically switch between the "Approved Date" and "Created Date" based on the status.&lt;/P&gt;&lt;P&gt;4. Create a date slicer using the Calendar table's date column. When you use this slicer, the `LoanAmountSum` measure will consider the appropriate date based on the status selected.&lt;/P&gt;&lt;P&gt;By following these steps, you can sum up the loan amount using the `USERELATIONSHIP` function with multiple criteria to switch dates based on the status column in Power BI.&lt;/P&gt;</description>
      <pubDate>Mon, 04 Sep 2023 09:13:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-use-USERELATIONSHIP-with-multiple-Criteria-to-switch/m-p/3413469#M129096</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2023-09-04T09:13:27Z</dc:date>
    </item>
  </channel>
</rss>

