<?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: Target measure sums targets for 2 FY's when week stretches over FY in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-measure-sums-targets-for-2-FY-s-when-week-stretches-over/m-p/2667322#M79360</link>
    <description>&lt;P&gt;Thanks! A bit of a ah yeah moment.&amp;nbsp; Makes sense to get the minimum date in the week, lookup what financial year that is, then do the sum on the target table only where dates match that financial year.&lt;/P&gt;</description>
    <pubDate>Thu, 28 Jul 2022 12:34:57 GMT</pubDate>
    <dc:creator>SteveCarter1</dc:creator>
    <dc:date>2022-07-28T12:34:57Z</dc:date>
    <item>
      <title>Target measure sums targets for 2 FY's when week stretches over FY</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-measure-sums-targets-for-2-FY-s-when-week-stretches-over/m-p/2667059#M79335</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;I have a problem when viewing a chart in Start of Week X-Axis where my target measure (the yellow line in the chart below) is suming targets that span over 2 financial years but only for the single week where it crosses over a financial year boundary.&lt;/P&gt;&lt;P&gt;For example Sunday, Monday and Tuesday are in FY 2021-2022 and Wednesday, Thursday, Friday and Saturday are in FY 2022-2023&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;I have some targets against different services in an excel file where I specify the Financial Year they apply:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Service&lt;/TD&gt;&lt;TD&gt;Target&lt;/TD&gt;&lt;TD&gt;Financial Year&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;100&lt;/TD&gt;&lt;TD&gt;2021-2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;110&lt;/TD&gt;&lt;TD&gt;2021-2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;120&lt;/TD&gt;&lt;TD&gt;2021-2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;130&lt;/TD&gt;&lt;TD&gt;2021-2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;140&lt;/TD&gt;&lt;TD&gt;2021-2022&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;A&lt;/TD&gt;&lt;TD&gt;101&lt;/TD&gt;&lt;TD&gt;2022-2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;B&lt;/TD&gt;&lt;TD&gt;111&lt;/TD&gt;&lt;TD&gt;2022-2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;C&lt;/TD&gt;&lt;TD&gt;121&lt;/TD&gt;&lt;TD&gt;2022-2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;D&lt;/TD&gt;&lt;TD&gt;131&lt;/TD&gt;&lt;TD&gt;2022-2023&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;E&lt;/TD&gt;&lt;TD&gt;141&lt;/TD&gt;&lt;TD&gt;2022-2023&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have a master calendar table that labels every day with its Financial Year then have a relationship between those 2 tables which is how I link the FY tag to a date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my simple measure to show the target line:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;FYClientTarget = 
                IF( ISBLANK(
                        SUM(
                            'Client Targets'[Target]
                        )
                    ),
                    BLANK(),
                    SUM(
                         'Client Targets'[Target]
                    )
                )&lt;/LI-CODE&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;P&gt;I understand what is happening but not how to fix it.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;The SUM function is seeing for that 1 week, there are 2 targets for each service - one for 2021-2022 and another for 2022-2023 because there are days that fall into both financial years so it is adding up both targets for all services.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I think I need to find some way to do a group or distinct or even a min type of function or filter to end up with only ever 1 target for any given X-Axis level (in this case per week) and ideally the target value that should be used is the one that applies to the first date in the X-Axis group (e.g. the first day of that week only when viewing using week X-Axis).&lt;/P&gt;&lt;P&gt;All other X-Axis views are fine because they don't span over the financial year boundry, such as month, quarter, year etc.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Any ideas how I can sort this out?&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 09:48:48 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-measure-sums-targets-for-2-FY-s-when-week-stretches-over/m-p/2667059#M79335</guid>
      <dc:creator>SteveCarter1</dc:creator>
      <dc:date>2022-07-28T09:48:48Z</dc:date>
    </item>
    <item>
      <title>Re: Target measure sums targets for 2 FY's when week stretches over FY</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-measure-sums-targets-for-2-FY-s-when-week-stretches-over/m-p/2667188#M79346</link>
      <description>&lt;P&gt;Try&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;FY Client Target =
VAR minDate =
    MIN ( 'Date'[Date] )
VAR FY =
    LOOKUPVALUE ( 'Date'[FY], 'Date'[Date], minDate )
VAR target =
    CALCULATE ( SUM ( 'Client Targets'[Target] ), 'Date'[FY] = FY )
RETURN
    IF ( NOT ISBLANK ( target ), target )&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 28 Jul 2022 11:18:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-measure-sums-targets-for-2-FY-s-when-week-stretches-over/m-p/2667188#M79346</guid>
      <dc:creator>johnt75</dc:creator>
      <dc:date>2022-07-28T11:18:25Z</dc:date>
    </item>
    <item>
      <title>Re: Target measure sums targets for 2 FY's when week stretches over FY</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-measure-sums-targets-for-2-FY-s-when-week-stretches-over/m-p/2667322#M79360</link>
      <description>&lt;P&gt;Thanks! A bit of a ah yeah moment.&amp;nbsp; Makes sense to get the minimum date in the week, lookup what financial year that is, then do the sum on the target table only where dates match that financial year.&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2022 12:34:57 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Target-measure-sums-targets-for-2-FY-s-when-week-stretches-over/m-p/2667322#M79360</guid>
      <dc:creator>SteveCarter1</dc:creator>
      <dc:date>2022-07-28T12:34:57Z</dc:date>
    </item>
  </channel>
</rss>

