<?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: DAX help needed - inherited code timing out in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223798#M52876</link>
    <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error generated:&lt;/P&gt;&lt;P&gt;A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.&lt;/P&gt;</description>
    <pubDate>Mon, 06 Dec 2021 20:55:06 GMT</pubDate>
    <dc:creator>duncfair</dc:creator>
    <dc:date>2021-12-06T20:55:06Z</dc:date>
    <item>
      <title>DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223354#M52851</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance for any help you can send my way.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have inherited a report with some (to me, anyway) complex DAX that I have been told is causing my time-out issues.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Please let me know what else I would need to post to provide enough information for assistance.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;&lt;P&gt;SelectedFcst =&lt;BR /&gt;VAR Mth = [SelectedKPI_Month]&lt;BR /&gt;VAR Qtr = [SelectedKPI_Qtr]&lt;BR /&gt;VAR CY = [Current_FY]&lt;BR /&gt;VAR CM = [Current_Mth]&lt;BR /&gt;RETURN&lt;BR /&gt;SWITCH([SelectedKPI_Version],&lt;BR /&gt;// Current Forecast&lt;BR /&gt;2, SWITCH([SelectedKPI_Time],&lt;BR /&gt;// FY&lt;BR /&gt;1, CALCULATE(sum(Rev_Consol_Pivot_PowerBI[Current]), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[Is_Current_Yr] = "Yes")),&lt;BR /&gt;// YTD&lt;BR /&gt;2, CALCULATE(sum(Rev_Consol_Pivot_PowerBI[Current]), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[FiscalMonthofYear] &amp;lt;= Mth), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[Is_Current_Yr] = "Yes")),&lt;BR /&gt;// QTD&lt;BR /&gt;3, CALCULATE(sum(Rev_Consol_Pivot_PowerBI[Current]), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[FiscalMonthofYear] &amp;lt;= Mth), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[FiscalQuarter] = Qtr), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[FiscalYear] = [Current_FY])),&lt;BR /&gt;// MTD&lt;BR /&gt;4, IF(Mth = CM, CALCULATE(sum(Rev_Consol_Pivot_PowerBI[Current]), vw_FiscalCal[SelectedMonth] = "Yes", vw_FiscalCal[Is_Current_Yr] = "Yes"), CALCULATE(SUM(Rev_Consol_Pivot_PowerBI[Current]), Rev_Consol_Pivot_PowerBI[FiscalMonth] = Mth, Rev_Consol_Pivot_PowerBI[FiscalYear] = CY)&lt;BR /&gt;)),&lt;BR /&gt;// Prior Forecast&lt;BR /&gt;4, SWITCH([SelectedKPI_Time],&lt;BR /&gt;// FY&lt;BR /&gt;1, CALCULATE(sum(Rev_Consol_Pivot_PowerBI[Prior]), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[Is_Current_Yr] = "Yes")),&lt;BR /&gt;// YTD&lt;BR /&gt;2, CALCULATE(sum(Rev_Consol_Pivot_PowerBI[Prior]), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[FiscalMonthofYear] &amp;lt;= Mth), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[Is_Current_Yr] = "Yes")),&lt;BR /&gt;// QTD&lt;BR /&gt;3, CALCULATE(sum(Rev_Consol_Pivot_PowerBI[Prior]), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[FiscalMonthofYear] &amp;lt;= Mth), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[FiscalQuarter] = Qtr), FILTER(ALL(vw_FiscalCal), vw_FiscalCal[FiscalYear] = [Current_FY])),&lt;BR /&gt;// MTD&lt;BR /&gt;4, IF(Mth = CM, CALCULATE(sum(Rev_Consol_Pivot_PowerBI[Prior]), vw_FiscalCal[SelectedMonth] = "Yes", vw_FiscalCal[Is_Current_Yr] = "Yes"), CALCULATE(SUM(Rev_Consol_Pivot_PowerBI[Prior]), Rev_Consol_Pivot_PowerBI[FiscalMonth] = Mth, Rev_Consol_Pivot_PowerBI[FiscalYear] = CY)&lt;BR /&gt;))&lt;BR /&gt;)&lt;BR /&gt;----------------------------------------------------------------------------------------------------------------------&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 16:36:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223354#M52851</guid>
      <dc:creator>duncfair</dc:creator>
      <dc:date>2021-12-06T16:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223772#M52869</link>
      <description>&lt;P&gt;I haven't changed much, and I think what I have is mostly syntax sugar but hopefully it makes things a little more readable. Did however remove a second reference to [Current_FY] and used the pre calculated CY variable instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you see if this is any better (suspect not) and post any error messages you get.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SelectedFcst =
VAR Mth = [SelectedKPI_Month]
VAR Qtr = [SelectedKPI_Qtr]
VAR CY = [Current_FY]
VAR CM = [Current_Mth]
RETURN
SWITCH([SelectedKPI_Version],
// Current Forecast
2, SWITCH([SelectedKPI_Time],
// FY
1, CALCULATE(
		SUM(Rev_Consol_Pivot_PowerBI[Current]), 
		REMOVEFILTERS(vw_FiscalCal), 
		vw_FiscalCal[Is_Current_Yr] = "Yes"),
// YTD
2, CALCULATE(
		SUM(Rev_Consol_Pivot_PowerBI[Current]), 
		REMOVEFILTERS(vw_FiscalCal), 
		vw_FiscalCal[FiscalMonthofYear] &amp;lt;= Mth, 
		vw_FiscalCal[Is_Current_Yr] = "Yes"),
// QTD
3, CALCULATE(
		SUM(Rev_Consol_Pivot_PowerBI[Current]), 
		REMOVEFILTERS(vw_FiscalCal), 
		vw_FiscalCal[FiscalMonthofYear] &amp;lt;= Mth, 
		vw_FiscalCal[FiscalQuarter] = Qtr,
		vw_FiscalCal[FiscalYear] = CY),
// MTD
4, IF(
		Mth = CM, 
		CALCULATE(
			SUM(Rev_Consol_Pivot_PowerBI[Current]), 
			vw_FiscalCal[SelectedMonth] = "Yes", 
			vw_FiscalCal[Is_Current_Yr] = "Yes"), 
		CALCULATE(
			SUM(Rev_Consol_Pivot_PowerBI[Current]), 
			Rev_Consol_Pivot_PowerBI[FiscalMonth] = Mth, 
			Rev_Consol_Pivot_PowerBI[FiscalYear] = CY)
	),
// Prior Forecast
4, SWITCH([SelectedKPI_Time],
	// FY
	1, CALCULATE(
			SUM(Rev_Consol_Pivot_PowerBI[Prior]), 
			REMOVEFILTERS(vw_FiscalCal), 
			vw_FiscalCal[Is_Current_Yr] = "Yes"),
	// YTD
	2, CALCULATE(
			SUM(Rev_Consol_Pivot_PowerBI[Prior]), 
			REMOVEFILTERS(vw_FiscalCal), 
			vw_FiscalCal[FiscalMonthofYear] &amp;lt;= Mth, 
			vw_FiscalCal[Is_Current_Yr] = "Yes"),
	// QTD
	3, CALCULATE(
			SUM(Rev_Consol_Pivot_PowerBI[Prior]), 
			REMOVEFILTERS(vw_FiscalCal), 
			vw_FiscalCal[FiscalMonthofYear] &amp;lt;= Mth, 
			vw_FiscalCal[FiscalQuarter] = Qtr,
			vw_FiscalCal[FiscalYear] = CY),
	// MTD
	4, IF(
			Mth = CM, 
			CALCULATE(
				SUM(Rev_Consol_Pivot_PowerBI[Prior]), 
				vw_FiscalCal[SelectedMonth] = "Yes", 
				vw_FiscalCal[Is_Current_Yr] = "Yes"), 
			CALCULATE(
				SUM(Rev_Consol_Pivot_PowerBI[Prior]), 
				Rev_Consol_Pivot_PowerBI[FiscalMonth] = Mth, 
				Rev_Consol_Pivot_PowerBI[FiscalYear] = CY)
				))) &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 20:50:55 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223772#M52869</guid>
      <dc:creator>bcdobbs</dc:creator>
      <dc:date>2021-12-06T20:50:55Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223790#M52873</link>
      <description>&lt;P&gt;I'd expect this to help at least some having column filters rather than table filters.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;P.S. There's one remaining&amp;nbsp;[Current_FY] you probably want to replace.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 20:47:04 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223790#M52873</guid>
      <dc:creator>AlexisOlson</dc:creator>
      <dc:date>2021-12-06T20:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223796#M52875</link>
      <description>&lt;P&gt;Good spot, have updated.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 20:51:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223796#M52875</guid>
      <dc:creator>bcdobbs</dc:creator>
      <dc:date>2021-12-06T20:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223798#M52876</link>
      <description>&lt;P&gt;Thanks!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;error generated:&lt;/P&gt;&lt;P&gt;A function 'PLACEHOLDER' has been used in a True/False expression that is used as a table filter expression. This is not allowed.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 20:55:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223798#M52876</guid>
      <dc:creator>duncfair</dc:creator>
      <dc:date>2021-12-06T20:55:06Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223801#M52877</link>
      <description>&lt;P&gt;That must have been prior to the update. No error now. I will test and circle back.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you so much!&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 20:57:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223801#M52877</guid>
      <dc:creator>duncfair</dc:creator>
      <dc:date>2021-12-06T20:57:45Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223903#M52891</link>
      <description>&lt;P&gt;Unfortunately - still timing out.&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>Mon, 06 Dec 2021 22:11:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223903#M52891</guid>
      <dc:creator>duncfair</dc:creator>
      <dc:date>2021-12-06T22:11:46Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223913#M52893</link>
      <description>&lt;P&gt;Can you tell us a bit about your infrastructure?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Specifically are you running in DirectQuery or Import mode?&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 22:25:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223913#M52893</guid>
      <dc:creator>bcdobbs</dc:creator>
      <dc:date>2021-12-06T22:25:00Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223919#M52894</link>
      <description>&lt;P&gt;Import.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 22:34:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223919#M52894</guid>
      <dc:creator>duncfair</dc:creator>
      <dc:date>2021-12-06T22:34:33Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223936#M52896</link>
      <description>&lt;P&gt;List of thoughts...&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;If you drop the measure into a very simple card visual does it process?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;In PowerQuery if you put a filter on to reduce data volume (eg limit it to previous 2 years) does the visual render? If so can you send a screen shot of what the visual is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Other things to look at:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Remove large chunks of the switch statement (or comment out the chunks and have it return a static value). To try and narrow down a particular aspect of the query. (Nothing jumps out).&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;I'd normally paste the query for the visual into dax studio and have a look at it's execution in there.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Lastly I wondered if you could split the measure out into a calculation group and use that to dynamically change the measure rather than a switch statement. I think doing it that way would remove the full execution that I assume is currently happening.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 22:50:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223936#M52896</guid>
      <dc:creator>bcdobbs</dc:creator>
      <dc:date>2021-12-06T22:50:21Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223942#M52897</link>
      <description>&lt;P&gt;Another route to try is to pre aggregate the data at refresh time.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I can write some more specific code when next by a computer but you want a calculated table that summarises the table that gets summed grouped by all your date columns.&lt;/P&gt;</description>
      <pubDate>Mon, 06 Dec 2021 23:03:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2223942#M52897</guid>
      <dc:creator>bcdobbs</dc:creator>
      <dc:date>2021-12-06T23:03:44Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2225644#M52984</link>
      <description>&lt;P&gt;The visual always renders in PowerBI desktop and occasionally renders in the service as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;May have to try the pre-aggregation route.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Dec 2021 14:50:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2225644#M52984</guid>
      <dc:creator>duncfair</dc:creator>
      <dc:date>2021-12-07T14:50:03Z</dc:date>
    </item>
    <item>
      <title>Re: DAX help needed - inherited code timing out</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2235633#M53396</link>
      <description>&lt;P&gt;No change - same issue.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Dec 2021 13:42:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/DAX-help-needed-inherited-code-timing-out/m-p/2235633#M53396</guid>
      <dc:creator>duncfair</dc:creator>
      <dc:date>2021-12-13T13:42:29Z</dc:date>
    </item>
  </channel>
</rss>

