<?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: Adapting Excel formula to Calculated Measure for Percent of Fiscal Year Elapsed in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adapting-Excel-formula-to-Calculated-Measure-for-Percent-of/m-p/3732824#M145475</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="697935" data-lia-user-login="jts44246" class="lia-mention lia-mention-user"&gt;jts44246&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can create a &lt;STRONG&gt;measure&lt;/STRONG&gt; as below with the same formula in Excel to get the same result...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
(
    1
        - (
            (
                DATE ( IF (
                    MONTH ( TODAY () - 1 ) &amp;gt; 7,
                    YEAR ( TODAY () - 1 ) + 1,
                    YEAR ( TODAY () - 1 )
                ), 6, 30 )
                    - TODAY () - 1
            ) / 365
        )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Thu, 29 Feb 2024 07:59:38 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-02-29T07:59:38Z</dc:date>
    <item>
      <title>Adapting Excel formula to Calculated Measure for Percent of Fiscal Year Elapsed</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adapting-Excel-formula-to-Calculated-Measure-for-Percent-of/m-p/3731273#M145414</link>
      <description>&lt;P&gt;I have an Excel formula that calculates the percent of fiscal year that elapsed for the current date, and I want to use it in a calculated measure to add it as a dimension field on a PivotTable Cube. However, Copilot generated an error when I tried to adapt it to a calculated measure. Here's the Excel formula:&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;=(1-((DATE(IF(MONTH(TODAY()-1)&amp;gt;7,YEAR(TODAY()-1)+1,YEAR(TODAY()-1)),6,30)-TODAY()-1)/365))&lt;/PRE&gt;&lt;P&gt;And here's what Copilot generated:&lt;/P&gt;&lt;DIV class=""&gt;&lt;SPAN&gt;Copy&lt;/SPAN&gt;&lt;DIV class=""&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;&lt;PRE&gt;WITH MEMBER [Measures].[MyCalculatedMeasure] AS
    '1 - (
      (
        DateSerial(
          IIf(Month(NOW() - 1) &amp;gt; 7, Year(NOW() - 1) + 1, Year(NOW() - 1)),
          6,
          30
        ) - NOW() - 1
      ) / 365'
SELECT
  [Measures].[MyCalculatedMeasure] ON 0
FROM [munprod_General Ledger Cubes]&lt;/PRE&gt;&lt;P&gt;Does anyone know how to fix this error and adapt the Excel formula to a calculated measure?&lt;/P&gt;</description>
      <pubDate>Wed, 28 Feb 2024 17:20:27 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adapting-Excel-formula-to-Calculated-Measure-for-Percent-of/m-p/3731273#M145414</guid>
      <dc:creator>jts44246</dc:creator>
      <dc:date>2024-02-28T17:20:27Z</dc:date>
    </item>
    <item>
      <title>Re: Adapting Excel formula to Calculated Measure for Percent of Fiscal Year Elapsed</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adapting-Excel-formula-to-Calculated-Measure-for-Percent-of/m-p/3732824#M145475</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="697935" data-lia-user-login="jts44246" class="lia-mention lia-mention-user"&gt;jts44246&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;You can create a &lt;STRONG&gt;measure&lt;/STRONG&gt; as below with the same formula in Excel to get the same result...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
(
    1
        - (
            (
                DATE ( IF (
                    MONTH ( TODAY () - 1 ) &amp;gt; 7,
                    YEAR ( TODAY () - 1 ) + 1,
                    YEAR ( TODAY () - 1 )
                ), 6, 30 )
                    - TODAY () - 1
            ) / 365
        )
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 29 Feb 2024 07:59:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adapting-Excel-formula-to-Calculated-Measure-for-Percent-of/m-p/3732824#M145475</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-29T07:59:38Z</dc:date>
    </item>
    <item>
      <title>Re: Adapting Excel formula to Calculated Measure for Percent of Fiscal Year Elapsed</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adapting-Excel-formula-to-Calculated-Measure-for-Percent-of/m-p/3734133#M145539</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Where are you entering this script? I am adding it to the Edit Calculated Measure window (below) but I receive the follow error (further below).&amp;nbsp; Should this go somewhere else?&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&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>Thu, 29 Feb 2024 16:22:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adapting-Excel-formula-to-Calculated-Measure-for-Percent-of/m-p/3734133#M145539</guid>
      <dc:creator>jts44246</dc:creator>
      <dc:date>2024-02-29T16:22:59Z</dc:date>
    </item>
    <item>
      <title>Re: Adapting Excel formula to Calculated Measure for Percent of Fiscal Year Elapsed</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adapting-Excel-formula-to-Calculated-Measure-for-Percent-of/m-p/3735655#M145607</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="697935" data-lia-user-login="jts44246" class="lia-mention lia-mention-user"&gt;jts44246&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;What I using is Power BI Desktop, and &lt;A href="https://learn.microsoft.com/en-us/power-bi/transform-model/desktop-tutorial-create-measures" target="_self"&gt;create a measure&lt;/A&gt; in it. You can find the details in &lt;EM&gt;&lt;STRONG&gt;the attachment&lt;/STRONG&gt;&lt;/EM&gt;.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/fundamentals/desktop-getting-started" target="_blank"&gt;Get started with Power BI Desktop - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Where do you want to apply the calculation logic?&amp;nbsp; Excel or other software? Could you please provide some sample data and the expected result with backend scenario?&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Fri, 01 Mar 2024 07:26:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Adapting-Excel-formula-to-Calculated-Measure-for-Percent-of/m-p/3735655#M145607</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-03-01T07:26:00Z</dc:date>
    </item>
  </channel>
</rss>

