<?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: Help with the below power BI question in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-the-below-power-BI-question/m-p/3858884#M150732</link>
    <description>&lt;P&gt;Thank you aduguid&lt;/P&gt;&lt;P&gt;That worked.&lt;/P&gt;</description>
    <pubDate>Mon, 22 Apr 2024 11:19:56 GMT</pubDate>
    <dc:creator>grkanth81</dc:creator>
    <dc:date>2024-04-22T11:19:56Z</dc:date>
    <item>
      <title>Help with the below power BI question</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-the-below-power-BI-question/m-p/3851488#M150498</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;I would like to create a slicer with values 30 Days, 60 Days, 90 Days, 120 Days and Financial Year to date.&lt;/P&gt;&lt;P&gt;Financial year to date is 01/07/2023 in this scenario when you run the report today.&lt;/P&gt;&lt;P&gt;Here is the dummy data:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;company&lt;/TD&gt;&lt;TD&gt;Status&lt;/TD&gt;&lt;TD&gt;Date won or loss&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;ABC&lt;/TD&gt;&lt;TD&gt;won&lt;/TD&gt;&lt;TD&gt;29/03/2024&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;XYZ&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD&gt;&amp;nbsp;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;MDR&lt;/TD&gt;&lt;TD&gt;won&lt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;/TD&gt;&lt;TD&gt;won&lt;/TD&gt;&lt;TD&gt;18/04/2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;UFO&lt;/TD&gt;&lt;TD&gt;won&lt;/TD&gt;&lt;TD&gt;20/03/2023&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;I would like to create a table which shows summary of the above data groued by Company and&amp;nbsp;&lt;/P&gt;&lt;P&gt;when the user selects 30 Days the table should show the quantity won in the last 30 days from the report run date&lt;/P&gt;&lt;P&gt;when the user selects 60 Days the table should show the quantity won in the last 60 days&amp;nbsp;from the report run date&lt;/P&gt;&lt;P&gt;when the user selects 90 Days the table should show the quantity won in the last 90 days&amp;nbsp;from the report run date&lt;/P&gt;&lt;P&gt;when the user selects 120 Days the table should show the quantity won in the last 120 days&amp;nbsp;from the report run date&lt;/P&gt;&lt;P&gt;when the user selects Financial Year to date the table should show the quantity won in the&amp;nbsp;Financial Year to date (which is since 01/07/2023)&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example when the user selects 30 Days - ABC should show won as 2,&amp;nbsp;when the user selects 60 Days - ABC should show won as 2,&amp;nbsp;when the user selects 90 Days - ABC should show won as 3,&amp;nbsp;when the user selects 120Days - ABC should show won as 3,&amp;nbsp;when the user selects Financial Year to date - ABC should show won as 3.&lt;/P&gt;&lt;P&gt;Can you please provide your assistance and let me know how to achieve above ?&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 02:42:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-the-below-power-BI-question/m-p/3851488#M150498</guid>
      <dc:creator>grkanth81</dc:creator>
      <dc:date>2024-04-19T02:42:50Z</dc:date>
    </item>
    <item>
      <title>Re: Help with the below power BI question</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-the-below-power-BI-question/m-p/3852538#M150513</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="27720" data-lia-user-login="grkanth81" class="lia-mention lia-mention-user"&gt;grkanth81&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It's a bit of a read, but this article shoudl hopefully answer your questions about calculating the fiscal amounts using a fiscal calendar&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://www.daxpatterns.com/custom-time-related-calculations/" target="_blank" rel="noopener"&gt;https://www.daxpatterns.com/custom-time-related-calculations/&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here is the measure that calculates the last months. Just add your new measure that you create above to this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Create a table with the column Cal and a column ID and then in the table view sort Cal by the ID&lt;BR /&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;CAL&lt;/TD&gt;&lt;TD&gt;ID&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;L30D&lt;/TD&gt;&lt;TD&gt;1&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;L60D&lt;/TD&gt;&lt;TD&gt;2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;L90D&lt;/TD&gt;&lt;TD&gt;3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;L120D&lt;/TD&gt;&lt;TD&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;/LI&gt;&lt;LI&gt;Create a measure in this table&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;CALC = MIN(NewTable[ID])​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Then Create this measureand Repeat for each time Frame&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Total - Last 120 Days = 
CALCULATE (
    [YourNewFiscalMeasure],
    DATESINPERIOD ( 'DIM_Date'[Date], MAX ( 'DIM_Date'[Date] ), -120, DAY)
)​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;The create this measure&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SelCalc = SWITCH([Calc],
1, [Total - Last 30 Days],
2, [Total - Last 60 Days],
3, [Total - Last 90 Days],
4, [Total - Last 120 Days])​&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Add a slicer to the canvas and add the Cal column from the generated table and make it single select&lt;/LI&gt;&lt;LI&gt;Add the SelCalc measure to a visual and add a Date, Year or Month also&lt;/LI&gt;&lt;LI&gt;You can then switch between calculations by selecting the filter&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Joe&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;If you found my answer helpful and it solved your issue, please accept as solution&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 06:49:53 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-the-below-power-BI-question/m-p/3852538#M150513</guid>
      <dc:creator>Joe_Barry</dc:creator>
      <dc:date>2024-04-19T06:49:53Z</dc:date>
    </item>
    <item>
      <title>Re: Help with the below power BI question</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-the-below-power-BI-question/m-p/3852749#M150518</link>
      <description>&lt;P&gt;You could create this DAX table and link it your date. Then set the sort column of "Ageing Days" to "Ageing Days Order". After that create a slicer from the&amp;nbsp;Ageing Days" column.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&amp;nbsp;&amp;nbsp;&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;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Calendar Ageing = 
VAR _today_date =        TODAY()
VAR _future_date =       CALCULATE(MIN(YourTable[Your_Date]))
VAR _fiscal_year =       YEAR(EDATE( _today_date, 6))
VAR _fiscal_year_start = DATE ( _fiscal_year - 3, 07, 01)
VAR _fiscal_year_end =   DATE ( _fiscal_year, 06, 30)
 
VAR _result = 
UNION (
      ADDCOLUMNS (CALENDAR ( _today_date - 30, _today_date),		"Ageing Days", "30 Days",		"Ageing Days Order", 1)
    , ADDCOLUMNS (CALENDAR ( _today_date - 60, _today_date),    	"Ageing Days", "60 Days",		"Ageing Days Order", 2)
    , ADDCOLUMNS (CALENDAR ( _today_date - 90, _today_date),		"Ageing Days", "90 Days",		"Ageing Days Order", 3)
    , ADDCOLUMNS (CALENDAR ( _today_date - 120, _today_date),   	"Ageing Days", "120 Days",		"Ageing Days Order", 4)
	, ADDCOLUMNS (CALENDAR ( _fiscal_year_start, _fiscal_year_end),	"Ageing Days", "YTD",			"Ageing Days Order", 6)
)

RETURN
_result&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 19 Apr 2024 07:53:44 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-the-below-power-BI-question/m-p/3852749#M150518</guid>
      <dc:creator>aduguid</dc:creator>
      <dc:date>2024-04-19T07:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Help with the below power BI question</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-the-below-power-BI-question/m-p/3858884#M150732</link>
      <description>&lt;P&gt;Thank you aduguid&lt;/P&gt;&lt;P&gt;That worked.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2024 11:19:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Help-with-the-below-power-BI-question/m-p/3858884#M150732</guid>
      <dc:creator>grkanth81</dc:creator>
      <dc:date>2024-04-22T11:19:56Z</dc:date>
    </item>
  </channel>
</rss>

