<?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 Filter calculates shifts the time in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2037888#M45712</link>
    <description>&lt;P&gt;Hello to all,&lt;/P&gt;&lt;P&gt;Here is a report of production monitoring of a hydraulic power plant. My problem concerns the graph below which corresponds to a flow monitoring sensor. My need : I would like to display the same values in the graph whose title is "Débits vigicrues (m3/s)" but with the values advanced by 4 hours. Example : The data in the tooltip whose value is "29" should appear on 18/08/2021 12:20:00 and not on 18/08/2021 08:20:00. I could advance 4 hours all my datetime column but in my case, the problem concerns only this flow sensor. The other sensors in my report are on the right time zone.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code of the flow measurement:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Q (m3/s) = CALCULATE(AVERAGE(fact_points_mesures_faucon[valeur])/1000,dim_mesure_faucon[groupement_mesure]="Debit_Vigicrue")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As well as the architecture of the data table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Would you have a solution for me please?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you in advance for your help,&lt;BR /&gt;Have a nice day,&lt;/P&gt;&lt;P&gt;Joël&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 25 Aug 2021 13:52:05 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2021-08-25T13:52:05Z</dc:date>
    <item>
      <title>Filter calculates shifts the time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2037888#M45712</link>
      <description>&lt;P&gt;Hello to all,&lt;/P&gt;&lt;P&gt;Here is a report of production monitoring of a hydraulic power plant. My problem concerns the graph below which corresponds to a flow monitoring sensor. My need : I would like to display the same values in the graph whose title is "Débits vigicrues (m3/s)" but with the values advanced by 4 hours. Example : The data in the tooltip whose value is "29" should appear on 18/08/2021 12:20:00 and not on 18/08/2021 08:20:00. I could advance 4 hours all my datetime column but in my case, the problem concerns only this flow sensor. The other sensors in my report are on the right time zone.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the code of the flow measurement:&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Q (m3/s) = CALCULATE(AVERAGE(fact_points_mesures_faucon[valeur])/1000,dim_mesure_faucon[groupement_mesure]="Debit_Vigicrue")&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As well as the architecture of the data table:&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;Would you have a solution for me please?&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Thank you in advance for your help,&lt;BR /&gt;Have a nice day,&lt;/P&gt;&lt;P&gt;Joël&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 13:52:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2037888#M45712</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-25T13:52:05Z</dc:date>
    </item>
    <item>
      <title>Re: Filter calculates shifts the time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2037938#M45715</link>
      <description>&lt;P&gt;Just create a custom tooltip...&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 14:14:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2037938#M45715</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-25T14:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Filter calculates shifts the time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2037945#M45716</link>
      <description>&lt;P&gt;Hi Anonymous&lt;/LI-USER&gt;&lt;/P&gt;
&lt;P&gt;How about creating a new column in which you add the four hours only for that sensor and leave the time unchanged for the others? You could also do this in Power query, which would probably be best.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;TABLE style="height: 100px; width: 100%; border-collapse: collapse; border-style: groove; border-color: #0c1c49; background-color: #00675f;" border="0" width="100%"&gt;
&lt;TBODY&gt;
&lt;TR style="height: 15px;"&gt;
&lt;TD width="15.961305925030231%" style="width: 92px; height: 15px;"&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;TD width="84.03869407496977%" style="width: 485px; height: 15px; text-align: left;"&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&lt;STRONG&gt;Please accept the solution when done and consider &lt;FONT color="#FF9900"&gt;giving a thumbs up if posts are helpful.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/SPAN&gt;&lt;/FONT&gt;&lt;FONT color="#FFFFFF"&gt;&lt;SPAN style="color: #ffffff;"&gt;&amp;nbsp;&lt;/SPAN&gt; &lt;/FONT&gt;&lt;BR /&gt;
&lt;P&gt;&lt;STRONG&gt;&lt;FONT size="4.5" color="#FF99CC"&gt;Contact me privately for support with any larger-scale BI needs, tutoring, etc.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/P&gt;
&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 14:16:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2037945#M45716</guid>
      <dc:creator>AlB</dc:creator>
      <dc:date>2021-08-25T14:16:10Z</dc:date>
    </item>
    <item>
      <title>Re: Filter calculates shifts the time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2038075#M45724</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp; and&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp; and thanks for your help,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Let me explain my problem in more detail.&lt;BR /&gt;In the graph framed in red below, you find the measurement of the realized power (green line) whose data are time-stamped at the right time zone.&lt;BR /&gt;The blue dotted line corresponds to the theoretical production according to a mathematical model.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below the measurement of the mathematical model:&lt;/P&gt;&lt;P&gt;"P_théorique_H07 (kW) =&lt;BR /&gt;VAR _P =&lt;BR /&gt;IF(&lt;BR /&gt;AND(12&amp;lt;=[Q (m3/s)],[Q (m3/s)]&amp;lt;21),&lt;BR /&gt;12.33271181*[Q (m3/s)]^2+(-426.5508019)*[Q (m3/s)]+4287.235691&lt;BR /&gt;)&lt;BR /&gt;+&lt;BR /&gt;IF(&lt;BR /&gt;AND(23&amp;lt;=[Q (m3/s)],[Q (m3/s)]&amp;lt;32),&lt;BR /&gt;3.391495147*[Q (m3/s)]^2+(-162.8664303)*[Q (m3/s)]+2672.165273&lt;BR /&gt;)&lt;BR /&gt;+&lt;BR /&gt;IF(&lt;BR /&gt;AND(34&amp;lt;=[Q (m3/s)],[Q (m3/s)]&amp;lt;43),&lt;BR /&gt;-2.186881051*[Q (m3/s)]^2+184.5489415*[Q (m3/s)]+(-2870.04308)&lt;BR /&gt;)&lt;BR /&gt;+&lt;BR /&gt;IF(&lt;BR /&gt;43&amp;lt;=[Q (m3/s)],&lt;BR /&gt;0.001673895*[Q (m3/s)]^2+(-2.044218339)*[Q (m3/s)]+1098.267649&lt;BR /&gt;)&lt;BR /&gt;return&lt;BR /&gt;IF([Q (m3/s)]&amp;lt;12,0,_P)"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;As you can see I am using the measurement "Q (m3/s)" To create my model:&lt;/P&gt;&lt;P&gt;"Q (m3/s) = CALCULATE(AVERAGE(fact_points_mesures_faucon[valeur])/1000,dim_mesure_faucon[groupement_mesure]="Debit_Vigicrue")"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The theoretical mathematical model measurement is working fine but it is off by 4h with the realized production line as you can see on the graph.&lt;BR /&gt;I would like them to be aligned by changing the timeline of the "Q (m3/s)" measure.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is it clearer?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance&lt;/P&gt;&lt;P&gt;Joël&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 15:13:18 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2038075#M45724</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-25T15:13:18Z</dc:date>
    </item>
    <item>
      <title>Re: Filter calculates shifts the time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2038294#M45729</link>
      <description>&lt;P&gt;OK. First, this is what I'd write as a mathematician &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;P_théorique_H07 (kW) =
var Q_Bounds =
	DATATABLE(
		"'Q_Bounds'[LowerBound]", integer,
		"'Q_Bounds'[UpperBound]", integer,
		"'Q_Bounds'[A]", double, 
		"'Q_Bounds'[B]", double,
		"'Q_Bounds'[C]", double,
		{
			{12, 21, 12.33271181, -426.5508019, 4287.235691},
			{23, 32, 3.391495147, -162.8664303, 2672.165273},
			{34, 43, -2.186881051, -2.044218339, 1098.267649},
			// 2^53-1 = 9007199254740991 -- max 64-bit int for DAX
			{34, 9007199254740991, 0.001673895, -2.044218339, 1098.267649}
		}
	)
var Q_ = [Q (m3/s)]
var P_ =
	MAXX(
		filter(
			// This filter will return at most 1 row
			// if the intervals defined by the bounds
			// are of the form [a, b) and are disjoint.
			Q_Bounds,
			'Q_Bounds'[LowerBound] &amp;lt;= Q_
			&amp;amp;&amp;amp;
			Q_ &amp;lt; 'Q_Bounds'[UpperBound]
		),
		var A_ = 'Q_Bounds'[A]
		var B_ = 'Q_Bounds'[B]
		var C_ = 'Q_Bounds'[C]
		return
			A_ * (Q_)^2 + B_ * (Q_) + C_
	)
return
	P_&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'll tell you exactly why you should write measures this way. It's because now it'll be easy to deal with your issue: you'll have to change this code in one place only, namely, where you calculate your Q_ variable.&lt;/P&gt;&lt;P&gt;Now, instead of [Q (m3/s)] in the above formula, you should use this modified version:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;[Q Shifted (m3/s)] =
var ShiftInHours = 4
var ShiftDirection = -1 -- or +1, you have to decide
var CurrentTime = MAX( YourTimeAxisTable[Time] )
var ShiftedTime = 
	CurrentTime	
		+ ShiftDirection
		* TIME( ShiftInHours, 0, 0 )
var Result = 
	CALCULATE(
		[Q (m3/s)],
		YourTimeAxisTable[Time] &amp;lt;= ShiftedTime,
		ALL( YourTimeAxisTable )
	)
return
	Result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Choose the direction of the shift.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;And I'll tell you even more. The table built in the first formula I'd move into a base table in the model so that it could be loaded from some source. This way your model would be truly dynamic. You'd be able to load it from some store, say SQL table. This would be the ultimate in flexibility.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Aug 2021 17:17:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2038294#M45729</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-25T17:17:49Z</dc:date>
    </item>
    <item>
      <title>Re: Filter calculates shifts the time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2039786#M45772</link>
      <description>&lt;P&gt;Wow&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;BR /&gt;First of all thank you for this impressive work, it's really very generous of you.&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Nevertheless, after doing the test I still have a similar result as can be seen below with the dotted line "P_New_théorique_H07 (kW)".&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Maybe there is a problem with my time table. I'm sharing my Pbix via OneDrive, could you please take a look at it?&lt;BR /&gt;&lt;A href="https://1drv.ms/u/s!Ao1OrcTeY008gYVc1kaZn5_ZUakonQ?e=xJXjpz" target="_blank"&gt;https://1drv.ms/u/s!Ao1OrcTeY008gYVc1kaZn5_ZUakonQ?e=xJXjpz&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance,&lt;/P&gt;&lt;P&gt;Joël&lt;/P&gt;&lt;P&gt;Translated with &lt;A href="http://www.DeepL.com/Translator" target="_blank"&gt;www.DeepL.com/Translator&lt;/A&gt; (free version)&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 08:24:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2039786#M45772</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-26T08:24:00Z</dc:date>
    </item>
    <item>
      <title>Re: Filter calculates shifts the time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2039842#M45777</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Yes, it may very well be that your time axis is not what I've assumed it to be. It may even be that my mental picture of your model is not right. I'm at work right now, hence I can't look at your file since I can't download it due to the&amp;nbsp; security policies. I'll have a look at this when I'm back home. I'm sure there's just a little bit of tweaking and it'll work.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 08:41:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2039842#M45777</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-26T08:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filter calculates shifts the time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2039844#M45778</link>
      <description>&lt;P&gt;Anonymous&lt;/a&gt;&amp;nbsp;That's nice, thank you very much for your time&lt;/P&gt;</description>
      <pubDate>Thu, 26 Aug 2021 08:43:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2039844#M45778</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-08-26T08:43:06Z</dc:date>
    </item>
    <item>
      <title>Re: Filter calculates shifts the time</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2054409#M46271</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="92178" data-lia-user-login="AlB" class="lia-mention lia-mention-user"&gt;AlB&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to ask you again about my problem because you seemed to have understood it well. Were you able to find something interesting?&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;Joël&lt;/P&gt;</description>
      <pubDate>Thu, 02 Sep 2021 15:26:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Filter-calculates-shifts-the-time/m-p/2054409#M46271</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-02T15:26:49Z</dc:date>
    </item>
  </channel>
</rss>

