<?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 How to dynamically change the max value in the gauge visual? in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-change-the-max-value-in-the-gauge-visual/m-p/4348712#M172724</link>
    <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;My daily target turnover is $270000. I have a slicer for the year. The data is from 01/01/2023. I want when only the year 2023 is slected in the slicer the maximum value should come as 365 * 270000 if only 2024 is selected from the slicer then the maximum value should come 365 * 270000 if both the years are selected then 730 * 270000 and so on. If in case nothing is selected in the slicer then it should calculate (Today() - date(2023,1,1)) * 270000&lt;/P&gt;&lt;P&gt;Can somebody please help me to achieve this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 02 Jan 2025 16:51:38 GMT</pubDate>
    <dc:creator>euro_sree</dc:creator>
    <dc:date>2025-01-02T16:51:38Z</dc:date>
    <item>
      <title>How to dynamically change the max value in the gauge visual?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-change-the-max-value-in-the-gauge-visual/m-p/4348712#M172724</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;&lt;P&gt;My daily target turnover is $270000. I have a slicer for the year. The data is from 01/01/2023. I want when only the year 2023 is slected in the slicer the maximum value should come as 365 * 270000 if only 2024 is selected from the slicer then the maximum value should come 365 * 270000 if both the years are selected then 730 * 270000 and so on. If in case nothing is selected in the slicer then it should calculate (Today() - date(2023,1,1)) * 270000&lt;/P&gt;&lt;P&gt;Can somebody please help me to achieve this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 16:51:38 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-change-the-max-value-in-the-gauge-visual/m-p/4348712#M172724</guid>
      <dc:creator>euro_sree</dc:creator>
      <dc:date>2025-01-02T16:51:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically change the max value in the gauge visual?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-change-the-max-value-in-the-gauge-visual/m-p/4348802#M172725</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="907590" data-lia-user-login="euro_sree" class="lia-mention lia-mention-user"&gt;euro_sree&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;To achieve your requirement, you can create a DAX measure that dynamically calculates the maximum value based on the selected year(s) in the slicer. Here’s how to do it:&lt;/P&gt;&lt;H3&gt;Steps:&lt;/H3&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Assume You Have a Date Table&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Make sure your data model includes a properly set up Date table, with a relationship to your fact table containing turnover data.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Create the Measure&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use the following DAX code to create the measure:&lt;/LI&gt;&lt;/UL&gt;&lt;PRE&gt;Maximum Target Turnover = 
VAR SelectedYears = VALUES(DateTable[Year]) -- Get the selected years
VAR TotalDays =
    IF(
        ISFILTERED(DateTable[Year]),
        SUMX(SelectedYears, 365), -- Calculate total days for selected years
        TODAY() - DATE(2023, 1, 1) -- Days from 01/01/2023 to today
    )
RETURN
    TotalDays * 270000&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Explanation&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;VALUES(DateTable[Year])&lt;/STRONG&gt;: Captures the selected years from the slicer.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;SUMX(SelectedYears, 365)&lt;/STRONG&gt;: Calculates the total days for all selected years (365 days per year).&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;ISFILTERED(DateTable[Year])&lt;/STRONG&gt;: Checks if the slicer has any filter applied; if not, it defaults to calculating the days from 01/01/2023 to TODAY().&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;270000&lt;/STRONG&gt;: The daily target turnover is multiplied by the total days.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Add the Measure to Your Visual&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Use the measure in a card or visual to display the calculated maximum target turnover.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Test the Functionality&lt;/STRONG&gt;:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Select different years in the slicer and verify that the calculation changes accordingly.&lt;/LI&gt;&lt;LI&gt;If nothing is selected in the slicer, ensure the calculation uses (Today() - DATE(2023,1,1)) * 270000.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;This measure is dynamic and should meet your requirement for handling both slicer selections and the default case when nothing is selected. Let me know if you need further adjustments! &lt;span class="lia-unicode-emoji" title=":smiling_face_with_smiling_eyes:"&gt;😊&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;Please mark this as solution if it helps. Appreciate Kudos.&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 02 Jan 2025 18:17:12 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-change-the-max-value-in-the-gauge-visual/m-p/4348802#M172725</guid>
      <dc:creator>FarhanJeelani</dc:creator>
      <dc:date>2025-01-02T18:17:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically change the max value in the gauge visual?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-change-the-max-value-in-the-gauge-visual/m-p/4349197#M172737</link>
      <description>&lt;P&gt;Hi Farhan&lt;/P&gt;&lt;P&gt;Thank you so much for the solution and appreciate the way its been explained.&lt;/P&gt;&lt;P&gt;I will try this today and update you.&lt;/P&gt;&lt;P&gt;Regards&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 04:23:14 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-change-the-max-value-in-the-gauge-visual/m-p/4349197#M172737</guid>
      <dc:creator>euro_sree</dc:creator>
      <dc:date>2025-01-03T04:23:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to dynamically change the max value in the gauge visual?</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-change-the-max-value-in-the-gauge-visual/m-p/4349303#M172739</link>
      <description>&lt;P&gt;Hi &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="907590" data-lia-user-login="euro_sree" class="lia-mention lia-mention-user"&gt;euro_sree&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;The method&amp;nbsp;FarhanJeelani&amp;nbsp;provided should be helpful.&lt;/P&gt;
&lt;P&gt;Besides, you can also try the following DAX formula to calculate the max value based on slicer.&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Maximum Target Turnover = 
VAR SelectedYears = VALUES('Table'[Year])
VAR StartDate = DATE(2023, 1, 1)
VAR TodayDate = TODAY()
RETURN
IF (
    ISFILTERED('Table'[Year]),
    CALCULATE(COUNTROWS('Table') * 270000),
    DATEDIFF(StartDate, TodayDate, DAY) * 270000
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;/P&gt;
&lt;P&gt;Wisdom Wu&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If this post&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;helps&lt;/EM&gt;&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;&lt;EM&gt;Accept it as the solution&lt;/EM&gt;&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 03 Jan 2025 06:15:42 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/How-to-dynamically-change-the-max-value-in-the-gauge-visual/m-p/4349303#M172739</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2025-01-03T06:15:42Z</dc:date>
    </item>
  </channel>
</rss>

