<?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 Set default current year monthly values when options of slicer are not selected. in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-default-current-year-monthly-values-when-options-of-slicer/m-p/3491120#M133670</link>
    <description>&lt;P&gt;Hi guys, I have 2 tables - Date_ref and Asset. Date_ref is date table. Asset have monthly total asset value in which there are data from Jan 2021 - Aug 2023. I used a slider by year, if a year is selected, the monthly total asset values are displayed.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When select 2023 in slider, it displays Jan-Aug&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I want to show data of current year (2023) as default when there is no tile in slicer selected, so i try writing the DAX below:&lt;/P&gt;&lt;P&gt;Total Asset =&lt;BR /&gt;VAR max_year = CALCULATE(MAX(Dates_ref[Year]))&lt;/P&gt;&lt;P&gt;VAR asset = CALCULATE(SUM(Asset[Value]), Asset[Attribute] = "Total Asset")&lt;/P&gt;&lt;P&gt;VAR default_asset = CALCULATE(SUM(Asset[Value]), Asset[Attribute] = "Total Asset", Dates_ref[Year] = max_year)&lt;/P&gt;&lt;P&gt;Return IF(NOT(ISFILTERED(Dates_ref)), default_asset, asset)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However the output is not as expected&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;When I do not select any tile in slider, output display incorrect values, it also display 12 months while 2023 just have Jan - Aug.&lt;/P&gt;&lt;P&gt;How to&amp;nbsp;show data of current year (2023) as default, Is there any problem with IF or ISFILTERED?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
    <pubDate>Mon, 23 Oct 2023 10:46:08 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-10-23T10:46:08Z</dc:date>
    <item>
      <title>Set default current year monthly values when options of slicer are not selected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-default-current-year-monthly-values-when-options-of-slicer/m-p/3491120#M133670</link>
      <description>&lt;P&gt;Hi guys, I have 2 tables - Date_ref and Asset. Date_ref is date table. Asset have monthly total asset value in which there are data from Jan 2021 - Aug 2023. I used a slider by year, if a year is selected, the monthly total asset values are displayed.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When select 2023 in slider, it displays Jan-Aug&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;I want to show data of current year (2023) as default when there is no tile in slicer selected, so i try writing the DAX below:&lt;/P&gt;&lt;P&gt;Total Asset =&lt;BR /&gt;VAR max_year = CALCULATE(MAX(Dates_ref[Year]))&lt;/P&gt;&lt;P&gt;VAR asset = CALCULATE(SUM(Asset[Value]), Asset[Attribute] = "Total Asset")&lt;/P&gt;&lt;P&gt;VAR default_asset = CALCULATE(SUM(Asset[Value]), Asset[Attribute] = "Total Asset", Dates_ref[Year] = max_year)&lt;/P&gt;&lt;P&gt;Return IF(NOT(ISFILTERED(Dates_ref)), default_asset, asset)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However the output is not as expected&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;When I do not select any tile in slider, output display incorrect values, it also display 12 months while 2023 just have Jan - Aug.&lt;/P&gt;&lt;P&gt;How to&amp;nbsp;show data of current year (2023) as default, Is there any problem with IF or ISFILTERED?&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance!&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 10:46:08 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-default-current-year-monthly-values-when-options-of-slicer/m-p/3491120#M133670</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-23T10:46:08Z</dc:date>
    </item>
    <item>
      <title>Re: Set default current year monthly values when options of slicer are not selected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-default-current-year-monthly-values-when-options-of-slicer/m-p/3491284#M133677</link>
      <description>&lt;P&gt;I would suggest using&amp;nbsp;SELECTEDVALUE instead of&amp;nbsp;&lt;SPAN&gt;ISFILTERED, could you please try below?&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Total Asset =&lt;BR /&gt;VAR _selectedYear = SELECTEDVALUE(Dates_ref[Year])&lt;BR /&gt;VAR max_year = CALCULATE(MAX(Dates_ref[Year]))&lt;/P&gt;&lt;P&gt;VAR asset = CALCULATE(SUM(Asset[Value]), Asset[Attribute] = "Total Asset")&lt;/P&gt;&lt;P&gt;VAR default_asset = CALCULATE(SUM(Asset[Value]), Asset[Attribute] = "Total Asset", Dates_ref[Year] = max_year)&lt;/P&gt;&lt;P&gt;Return&lt;BR /&gt;IF(NOT(_selectedYear), default_asset, asset)&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 12:27:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-default-current-year-monthly-values-when-options-of-slicer/m-p/3491284#M133677</guid>
      <dc:creator>Walter_W2022</dc:creator>
      <dc:date>2023-10-23T12:27:54Z</dc:date>
    </item>
    <item>
      <title>Re: Set default current year monthly values when options of slicer are not selected.</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-default-current-year-monthly-values-when-options-of-slicer/m-p/3491878#M133704</link>
      <description>&lt;P&gt;It's worked, thank you so much.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 16:25:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Set-default-current-year-monthly-values-when-options-of-slicer/m-p/3491878#M133704</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-10-23T16:25:54Z</dc:date>
    </item>
  </channel>
</rss>

