<?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: Slowness in calculating the DAX Measure in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808736#M148917</link>
    <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="570958" data-lia-user-login="Rai_BI" class="lia-mention lia-mention-user"&gt;Rai_BI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Were you able to create the new dimension table(s) and get rid of the many-to-many relationships?&amp;nbsp; Were you able to do it in Power Query?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My version (done in DAX) was for demonstration purposes only.&amp;nbsp; Power Query would be MUCH better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How many rows in your production f_sales table?&lt;/P&gt;
&lt;P&gt;What is your datasource?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 03 Apr 2024 21:06:48 GMT</pubDate>
    <dc:creator>gmsamborn</dc:creator>
    <dc:date>2024-04-03T21:06:48Z</dc:date>
    <item>
      <title>Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808132#M148884</link>
      <description>&lt;P&gt;Hello friends,&lt;/P&gt;&lt;P&gt;I need help improving the performance of a DAX measure I created, as it is exceeding the available resources.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://lasdobrasilcombr-my.sharepoint.com/:u:/g/personal/rai_santos_las_app_br/EYEbL8gJi2pMlJz4pJQ_ijcB9_zuALmaf7bL8IwsH4SLUQ?e=mrmJ82" target="_self"&gt;Download PBIX here&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Each salesperson has goals and my goal is to break down the salespeople's goals for their respective customers.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First I need to calculate the percentage weight (%) of the customer in the seller's portfolio and multiply this percentage by the vendor's target, so I will have the client's target.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The problem is that the calculation is very heavy and is not carrying the visuals. In other words, I am unable to complete this task.&lt;/P&gt;&lt;P&gt;I need help optimizing the DAX measurement I made so that it loads the information in the visuals quickly.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the step by step of what I did:&lt;/P&gt;&lt;P&gt;DAX Measures&lt;/P&gt;&lt;P&gt;| Goals = SUM( f_goals[Goal] )&lt;BR /&gt;-------------------------------------------------- ------&lt;BR /&gt;| Sales Avarege =&lt;BR /&gt;VAR Sum =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[| Sales US$],&lt;BR /&gt;CALCULATETABLE(&lt;BR /&gt;DATESINPERIOD('dCalendar'[Date],&lt;BR /&gt;MAX('dCalendar'[Date]),&lt;BR /&gt;-12,&lt;BR /&gt;MONTH),&lt;BR /&gt;'dCalendar'[Month to Current Month] = 1&lt;BR /&gt;)&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;RETURN&lt;BR /&gt;IF(&lt;BR /&gt;ENDOFMONTH(&lt;BR /&gt;'dCalendar'[Date]),&lt;BR /&gt;Sum/12&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;-------------------------------------------------- ------&lt;/P&gt;&lt;P&gt;| Goal by Customer =&lt;/P&gt;&lt;P&gt;VAR _CustomerSales = [| Sales Avarege]&lt;/P&gt;&lt;P&gt;VAR _TotalSales =&lt;BR /&gt;CALCULATE(&lt;BR /&gt;[| Sales Avarege],&lt;BR /&gt;ALL('d_customer table'),&lt;BR /&gt;VALUES('d_Sellers (key)'[Seller ID])&lt;BR /&gt;)&lt;/P&gt;&lt;P&gt;VAR _PercentToTotal =&lt;BR /&gt;DIVIDE(_CustomerSales, _TotalSales)&lt;BR /&gt;VAR _PortfolioTarget = [| Goals]&lt;BR /&gt;VAR _CustomerTarget = _PercentToTotal * _PortfolioTarget&lt;BR /&gt;RETURN&lt;BR /&gt;_CustomerTarget&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;See below the 'Goal by Customer' measure which is working well when I don't add the customer in the visual.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, when I try to add customer information, Power BI cannot calculate it due to the calculation being too heavy.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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;</description>
      <pubDate>Wed, 03 Apr 2024 14:13:31 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808132#M148884</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-04-03T14:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808364#M148894</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="570958" data-lia-user-login="Rai_BI" class="lia-mention lia-mention-user"&gt;Rai_BI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I took a look at your model and noticed a couple of many-to-many relationships.&amp;nbsp; It turns out that they are the culprits.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I created a couple of extra dimension tables: d_categories and d_sellers (the oridinal d_sellers is now Sellers_Customers).&amp;nbsp; By making changes to the relationships, I came up with a model that looks like this:&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did this using DAX.&amp;nbsp; In practice, modelling changes like this should be done in Power Query (or the source).&amp;nbsp; Since I couldn't make changes in PQ, I had to do it in DAX.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I had to change the visuals to use the seller columns from the new d_seller dimension.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your measures will probably need a few changes.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please try to avoid many-to-many relationships whenever possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if you have any questions.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 16:47:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808364#M148894</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-04-03T16:47:25Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808446#M148897</link>
      <description>&lt;P&gt;Thank you very much! Can you explain why using the many-to-many relationship in this case makes the model slow?&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 17:22:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808446#M148897</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-04-03T17:22:16Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808468#M148901</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="570958" data-lia-user-login="Rai_BI" class="lia-mention lia-mention-user"&gt;Rai_BI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I think the biggest problem is how you relate 'd_customer_table' with 'd_sellers (key)'.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Your current structure of 'd_sellers (key)' actually looks like a bridge table.&amp;nbsp; By creating an actual dimension table for sellers and keeping the bridge table MIGHT make a difference.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would try to eliminate the other many-to-many relationships if possible.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'll look at changing the biggest problem (IMO) at get back to you.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 17:39:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808468#M148901</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-04-03T17:39:17Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808474#M148902</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="570958" data-lia-user-login="Rai_BI" class="lia-mention lia-mention-user"&gt;Rai_BI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I split 'd_sellers (Key)' into 'Sellers_Customers' and d_sellers'.&amp;nbsp; After changing the relationships, it seems to be closer to what you want.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I would still look at how having Category in d_products forces that other many-to-many.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 22:21:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808474#M148902</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-04-03T22:21:54Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808693#M148915</link>
      <description>&lt;P&gt;Performance improved a lot in the desktop version, however when publishing to the power bi service the visuals do not load as they exceed the available resources.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 20:27:39 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808693#M148915</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-04-03T20:27:39Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808736#M148917</link>
      <description>&lt;P&gt;HI&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="570958" data-lia-user-login="Rai_BI" class="lia-mention lia-mention-user"&gt;Rai_BI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Were you able to create the new dimension table(s) and get rid of the many-to-many relationships?&amp;nbsp; Were you able to do it in Power Query?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;My version (done in DAX) was for demonstration purposes only.&amp;nbsp; Power Query would be MUCH better.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;How many rows in your production f_sales table?&lt;/P&gt;
&lt;P&gt;What is your datasource?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 21:06:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808736#M148917</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-04-03T21:06:48Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808873#M148926</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="570958" data-lia-user-login="Rai_BI" class="lia-mention lia-mention-user"&gt;Rai_BI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I came up with the Power Query steps that you'll need.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;- duplicate 'd_products' and rename 'd_categories'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde"&gt;- select [Product Category ID] and [Product Category] and remove other columns&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde"&gt;- remove duplicates&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;- remove [Product Category] from 'd_products'&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;FONT face="arial black,avant garde"&gt;- duplicate 'd_Sellers (key)' and rename 'Sellers_Customers'&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde"&gt;- in 'Sellers_Customers', remove [Customer Name] and [Name Seller]&lt;/FONT&gt;&lt;BR /&gt;&lt;FONT face="arial black,avant garde"&gt;- in 'd_sellers', remove [Customer ID] and [Customer Name]&lt;/FONT&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Afterwards, you'll need to remove the many-to-many relationships and set up relationships for the new dimension tables.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Let me know if you have any questions.&lt;/P&gt;</description>
      <pubDate>Wed, 03 Apr 2024 22:58:51 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3808873#M148926</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-04-03T22:58:51Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3810737#M149038</link>
      <description>&lt;P&gt;Yes, I did everything you said. I did it directly from the source using SQL.&amp;nbsp;My real database is very similar to the example PBIX that I made available.&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;My real customer table has more than 10 thousand rows and my product table has more than 50 thousand rows.&lt;/P&gt;&lt;P&gt;The sales table has millions of rows as it has data from the last 5 years.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 12:04:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3810737#M149038</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-04-04T12:04:54Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3811007#M149045</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="570958" data-lia-user-login="Rai_BI" class="lia-mention lia-mention-user"&gt;Rai_BI&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you post an updated pbix?&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 13:25:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3811007#M149045</guid>
      <dc:creator>gmsamborn</dc:creator>
      <dc:date>2024-04-04T13:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Slowness in calculating the DAX Measure</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3811614#M149060</link>
      <description>&lt;P&gt;Of course, I updated the same pbix file as before and you can download it from the same link as above.&amp;nbsp;&lt;A href="https://lasdobrasilcombr-my.sharepoint.com/:u:/g/personal/rai_santos_las_app_br/EYEbL8gJi2pMlJz4pJQ_ijcB9_zuALmaf7bL8IwsH4SLUQ?e=mrmJ82" target="_self" rel="nofollow noopener noreferrer"&gt;Download PBIX here&lt;/A&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I just made a small change in that the filter direction I kept as "both", as it is important to count how many customers there are in each seller's portfolio.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2024 17:35:23 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Slowness-in-calculating-the-DAX-Measure/m-p/3811614#M149060</guid>
      <dc:creator>Rai_BI</dc:creator>
      <dc:date>2024-04-04T17:35:23Z</dc:date>
    </item>
  </channel>
</rss>

