<?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: Create Measure Indicator to show &amp;quot;1&amp;quot; for all dates from start of the year till the selected date in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/955604#M10941</link>
    <description>&lt;P&gt;Thanks. This worked for me. If I have to do it for Quarter, how to do that?&lt;/P&gt;</description>
    <pubDate>Mon, 02 Mar 2020 16:51:11 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2020-03-02T16:51:11Z</dc:date>
    <item>
      <title>Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954343#M10853</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to create a measure that should give me an indicator "1" from the start of the year until the selected date.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;For example, in the date filter if I selected 2/1/2020 then I should get an indicator "1" for 1/1/2020 and 2/1/2020 and "0" for all the other dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Below is the sample screenshot&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV class="mceNonEditable lia-copypaste-placeholder"&gt;&amp;nbsp;&lt;/DIV&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 21:56:17 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954343#M10853</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-01T21:56:17Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954348#M10854</link>
      <description>&lt;P&gt;So, perhaps something like:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Indicator =
  VAR __SelectedDate = SELECTEDVALUE('Date Filter'[Date])
  VAR __Date = MAX('Table'[Date])
  VAR __StartOfYear = DATE(YEAR(__SelectedDate),1,1)
  VAR __EndOfYear = DATE(YEAR(__SelectedDate),12,31)
RETURN
  IF(__Date &amp;gt;= __StartOfYear &amp;amp;&amp;amp; __Date &amp;lt;= __EndOfYear,1,0)&lt;/LI-CODE&gt;
&lt;P&gt;If you don't care about the end of the year, just get rid of that filter.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 22:00:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954348#M10854</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-01T22:00:54Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954361#M10856</link>
      <description>&lt;P&gt;Thanks.....I tried this but it is giving me 1 for all the date from 2017 to 2020.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I am using between for dates in slicer as shown below in the picture.&lt;img /&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 22:15:52 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954361#M10856</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-01T22:15:52Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954365#M10857</link>
      <description>&lt;P&gt;OK, yeah in that circumstance, SELECTEDVALUE will not work, try:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Indicator =
  VAR __SelectedDate = MAX('Date Filter'[Date])
  VAR __Date = MAX('Table'[Date])
  VAR __StartOfYear = DATE(YEAR(__SelectedDate),1,1)
  VAR __EndOfYear = DATE(YEAR(__SelectedDate),12,31)
RETURN
  IF(__Date &amp;gt;= __StartOfYear &amp;amp;&amp;amp; __Date &amp;lt;= __EndOfYear,1,0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;This is why details matter! &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 22:19:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954365#M10857</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-01T22:19:46Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954373#M10860</link>
      <description>&lt;P&gt;For some reason, this is still not working. I am using this Dax and I removed the EndOfYear Dax and still gives me 1 for all the date range from 2017 to 2020&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;TEST = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR __SelectedDate = MAX('ESL_Date_Dim'[DateValue])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR __Date = MAX(ESL_Date_Dim[DateValue])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR __StartOfYear = DATE(YEAR(__SelectedDate),1,1)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF(__Date &amp;gt;= __StartOfYear,1,0)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;img /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 01 Mar 2020 22:31:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954373#M10860</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-01T22:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954382#M10862</link>
      <description>&lt;P&gt;Not sure, see attached PBIX where it seems to function fine.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 22:36:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954382#M10862</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-01T22:36:08Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954400#M10868</link>
      <description>&lt;P&gt;ohhh!!!!! This pbix has 2 tables one date dim and another table and your dax is using one date from date dim and one from another table.&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;"VAR __SelectedDate = MAX('Calendar'[Date])&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR __Date = MAX('Table'[Date])"&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;In my case, my pbix has 5 facts that are connected to datevalue from date dim.&amp;nbsp;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;How to use all 5 facts date in "VAR __Date = MAX('Table'[Date])"?&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Sun, 01 Mar 2020 23:12:07 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954400#M10868</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-01T23:12:07Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954402#M10870</link>
      <description>&lt;P&gt;OK, we probably need to back up here. My first question would be, if all of your tables are connected via a single Date filter and you are slicing on that date filter, how is it that you have a table visualization that would show all of your dates in the first place? Are you using Edit Interactions? Second, I'd need to see your model with how all the tables are connected together. Third, I probably need some more clarity around exactly what you are trying to achieve here and what columns and measures will be in the visual that you are trying to create.&lt;/P&gt;</description>
      <pubDate>Sun, 01 Mar 2020 23:16:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954402#M10870</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-01T23:16:38Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954420#M10873</link>
      <description>&lt;P&gt;&lt;SPAN&gt;My first question would be, if all of your tables are connected via a single Date filter and you are slicing on that date filter, how is it that you have a table visualization that would show all of your dates in the first place? &lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;All my facts are connected to date dim by date and I am using "Date" from my date dimension in my slicer.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;Second, I'd need to see your model with how all the tables are connected together.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Yes, All my facts are connected to the Date dimension. We are doing this modeling in the Time Xtender tool by creating a Semantic layer and publishing it to SSAS. (Instead of creating SSAS models in visual studio we are using&amp;nbsp;Time Xtender tool for creating models)&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Third, I probably need some more clarity around exactly what you are trying to achieve here and what columns and measures will be in the visual that you are trying to create.&lt;img /&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;I am sorry......I should have provided more information in the beginning.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 00:13:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954420#M10873</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T00:13:45Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954430#M10874</link>
      <description>&lt;P&gt;OK&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;here are the issues that I see with this approach. You have a Date dimension that is connected to all of your tables. You can select a range of these and they will presumably show up in a table visualization. So far so good.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Now the question is, what Date are you displaying in your table visualization? Because if it is the Date from the Dimension table, there is a problem. Once you&amp;nbsp;introduce your measure into that visualization. If you use SELECTEDVALUE or MAX to retrieve the Date, it will retrieve the date within the context of your table visualization, as in the date in the current row. This is not what you want, you want the date that is the maximum date within the slicer. So, what I believe will fix your problem in this case is to use ALLSELECTED:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Indicator = 
  VAR __SelectedDate = MAXX(ALLSELECTED('Calendar'[Date]),[Date])
  VAR __Date = MAX('Table'[Date])
  VAR __StartOfYear = DATE(YEAR(__SelectedDate),1,1)
  VAR __EndOfYear = DATE(YEAR(__SelectedDate),12,31)
RETURN
  IF(__Date &amp;gt;= __StartOfYear &amp;amp;&amp;amp; __Date &amp;lt;= __EndOfYear,1,0)&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;However, if this is not the case there is likely a different solution. I updated the PBIX and attached it to be more representative of your model. Now there is a relationship between the tables.&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 01:15:10 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/954430#M10874</guid>
      <dc:creator>Greg_Deckler</dc:creator>
      <dc:date>2020-03-02T01:15:10Z</dc:date>
    </item>
    <item>
      <title>Re: Create Measure Indicator to show "1" for all dates from start of the year till the selected date</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/955604#M10941</link>
      <description>&lt;P&gt;Thanks. This worked for me. If I have to do it for Quarter, how to do that?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Mar 2020 16:51:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Create-Measure-Indicator-to-show-quot-1-quot-for-all-dates-from/m-p/955604#M10941</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-03-02T16:51:11Z</dc:date>
    </item>
  </channel>
</rss>

