<?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 Using numeric range parameter in a column in Desktop</title>
    <link>https://community.fabric.microsoft.com/t5/Desktop/Using-numeric-range-parameter-in-a-column/m-p/4358495#M1361663</link>
    <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am dealing with a dataset about student lateness, with the following columns:&lt;BR /&gt;Day_x_Student_ID, Date, Student_ID, Late_min, Mentor_ID&lt;/P&gt;&lt;P&gt;I wanted to create a Column to determine whether the student is late for a given day:&lt;BR /&gt;IS_LATE = if(Late_min &amp;gt; Late_Threshold, True, Flase), where the Late_Threshold is determined by a slicer on a numeric range parameter.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I cannot use a measure,&amp;nbsp;&lt;/STRONG&gt;because a student can has 1 - N mentors for any given day. In order to present mentor-level data, each day can be duplicated for a student for a given day. Currently, I used&amp;nbsp;&lt;BR /&gt;IS_LATE = if(Late_min &amp;gt; Late_Threshold, Day_x_Student_ID), and used a measure&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DISTINCTCOUNTNOBLANK&lt;/SPAN&gt;&lt;SPAN&gt;([IS_LATE]) to count the number of late days.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I understand that column cannot dynamically reflect the slicer value of a parameter, but I do not understand why even after I refresh the data, it still cannot access the parameter.&lt;BR /&gt;The parameter is set up like this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Late_Threshold&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&lt;/SPAN&gt; &lt;SPAN&gt;GENERATESERIES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;60&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;), and&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Late Threshold Value =&lt;/SPAN&gt; &lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Late_Threshold'&lt;/SPAN&gt;&lt;SPAN&gt;[Late Threshold]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;When I use a Card, the card can represent the value of the parameter. But it seems like the&amp;nbsp;SELECTEDVALUE() function, when in a column, treated the parameter as a list, and always return the default value (10 in this case).&lt;BR /&gt;&lt;BR /&gt;Please help me I've been struggling for 10 hours.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 10 Jan 2025 09:15:26 GMT</pubDate>
    <dc:creator>tzuchiao</dc:creator>
    <dc:date>2025-01-10T09:15:26Z</dc:date>
    <item>
      <title>Using numeric range parameter in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Using-numeric-range-parameter-in-a-column/m-p/4358495#M1361663</link>
      <description>&lt;P&gt;Hi all,&lt;BR /&gt;&lt;BR /&gt;I am dealing with a dataset about student lateness, with the following columns:&lt;BR /&gt;Day_x_Student_ID, Date, Student_ID, Late_min, Mentor_ID&lt;/P&gt;&lt;P&gt;I wanted to create a Column to determine whether the student is late for a given day:&lt;BR /&gt;IS_LATE = if(Late_min &amp;gt; Late_Threshold, True, Flase), where the Late_Threshold is determined by a slicer on a numeric range parameter.&lt;BR /&gt;&lt;BR /&gt;&lt;STRONG&gt;I cannot use a measure,&amp;nbsp;&lt;/STRONG&gt;because a student can has 1 - N mentors for any given day. In order to present mentor-level data, each day can be duplicated for a student for a given day. Currently, I used&amp;nbsp;&lt;BR /&gt;IS_LATE = if(Late_min &amp;gt; Late_Threshold, Day_x_Student_ID), and used a measure&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;DISTINCTCOUNTNOBLANK&lt;/SPAN&gt;&lt;SPAN&gt;([IS_LATE]) to count the number of late days.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;I understand that column cannot dynamically reflect the slicer value of a parameter, but I do not understand why even after I refresh the data, it still cannot access the parameter.&lt;BR /&gt;The parameter is set up like this:&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Late_Threshold&lt;/SPAN&gt;&lt;SPAN&gt;&amp;nbsp;=&lt;/SPAN&gt; &lt;SPAN&gt;GENERATESERIES&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;60&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;5&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;), and&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Late Threshold Value =&lt;/SPAN&gt; &lt;SPAN&gt;SELECTEDVALUE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Late_Threshold'&lt;/SPAN&gt;&lt;SPAN&gt;[Late Threshold]&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;10&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;BR /&gt;&lt;BR /&gt;When I use a Card, the card can represent the value of the parameter. But it seems like the&amp;nbsp;SELECTEDVALUE() function, when in a column, treated the parameter as a list, and always return the default value (10 in this case).&lt;BR /&gt;&lt;BR /&gt;Please help me I've been struggling for 10 hours.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 09:15:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Using-numeric-range-parameter-in-a-column/m-p/4358495#M1361663</guid>
      <dc:creator>tzuchiao</dc:creator>
      <dc:date>2025-01-10T09:15:26Z</dc:date>
    </item>
    <item>
      <title>Re: Using numeric range parameter in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Using-numeric-range-parameter-in-a-column/m-p/4358599#M1361680</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="910902" data-lia-user-login="tzuchiao" class="lia-mention lia-mention-user"&gt;tzuchiao&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;The issue you’re facing arises because calculated columns in Power BI are computed at the data model level and are static—they don’t dynamically respond to slicers or filters in reports. This is why your calculated column cannot use the dynamic Late Threshold Value from the slicer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;H3&gt;&lt;STRONG&gt;Why This Happens&lt;/STRONG&gt;&lt;/H3&gt;&lt;UL&gt;&lt;LI&gt;&lt;STRONG&gt;Static Nature of Calculated Columns:&lt;/STRONG&gt; Calculated columns are computed once when the model is processed or refreshed. They do not recalculate based on slicers, filters, or user interactions in reports.&lt;/LI&gt;&lt;LI&gt;&lt;STRONG&gt;Dynamic Behavior with Measures:&lt;/STRONG&gt; Measures, on the other hand, are recalculated dynamically based on slicers and filters. However, measures cannot be used to create row-level evaluations directly within a column.&lt;/LI&gt;&lt;/UL&gt;&lt;H4&gt;&lt;STRONG&gt;Option 1: Use a Measure Instead&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;Instead of a calculated column, you can use a measure to determine whether the student was late. Here's how:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Define the measure:&lt;/P&gt;&lt;PRE&gt;Is_Late = 
VAR Late_Threshold_Value = SELECTEDVALUE('Late_Threshold'[Late Threshold], 10)
RETURN
IF(
    MAX('Table'[Late_min]) &amp;gt; Late_Threshold_Value, 
    TRUE(), 
    FALSE()
)&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Use this measure in your visualizations. For example, you can count the number of late days per mentor using:&lt;/P&gt;&lt;PRE&gt;Late_Days_Count = 
COUNTX(
    FILTER(
        'Table',
        [Is_Late] = TRUE()
    ),
    'Table'[Day_x_Student_ID]
)&lt;/PRE&gt;&lt;P&gt;This avoids creating a static column and directly ties the logic to the slicer.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H4&gt;&lt;STRONG&gt;Option 2: Simulate Row-Level Evaluation with Measures&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;If you need mentor-level or day-level aggregations, create an additional measure to calculate the distinct count of late days:&lt;/P&gt;&lt;PRE&gt;Late_Day_Count = 
VAR Late_Threshold_Value = SELECTEDVALUE('Late_Threshold'[Late Threshold], 10)
RETURN
DISTINCTCOUNT(
    FILTER(
        'Table',
        'Table'[Late_min] &amp;gt; Late_Threshold_Value
    )
)&lt;/PRE&gt;&lt;H4&gt;&lt;STRONG&gt;Option 3: Power Query Transformation&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;If slicer-based dynamic behavior isn’t mandatory, you can pre-compute the "Is_Late" column in Power Query by defining a threshold value (e.g., 10 minutes). You’ll lose slicer interactivity but avoid complexity:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Go to Power Query Editor.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Add a conditional column:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Name: Is_Late&lt;/LI&gt;&lt;LI&gt;Formula: if [Late_min] &amp;gt; 10 then "True" else "False"&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Load the data back to Power BI.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H4&gt;&lt;STRONG&gt;Option 4: Use a Dynamic Calculated Table&lt;/STRONG&gt;&lt;/H4&gt;&lt;P&gt;If you want dynamic behavior with slicers but still need row-level filtering, you can create a calculated table with slicer-driven filtering:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;Create a calculated table:&lt;/P&gt;&lt;PRE&gt;Late_Students = 
FILTER(
    'Table',
    'Table'[Late_min] &amp;gt; SELECTEDVALUE('Late_Threshold'[Late Threshold], 10)
)&lt;/PRE&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;Use this table in visuals for mentor-level analysis.&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;H3&gt;&lt;FONT color="#000000"&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;FONT face="arial,helvetica,sans-serif"&gt;Please mark this as solution if it helps you. Appreciate Kudos.&lt;/FONT&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;/FONT&gt;&lt;/H3&gt;</description>
      <pubDate>Fri, 10 Jan 2025 10:25:05 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Using-numeric-range-parameter-in-a-column/m-p/4358599#M1361680</guid>
      <dc:creator>FarhanJeelani</dc:creator>
      <dc:date>2025-01-10T10:25:05Z</dc:date>
    </item>
    <item>
      <title>Re: Using numeric range parameter in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Using-numeric-range-parameter-in-a-column/m-p/4359283#M1361843</link>
      <description>&lt;P&gt;Hello&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="910902" data-lia-user-login="tzuchiao" class="lia-mention lia-mention-user"&gt;tzuchiao&lt;/a&gt;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Can you please try this approach:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Count_Late_Days = 
VAR SelectedThreshold = SELECTEDVALUE(Late_Threshold[Late Threshold], 10)
RETURN
CALCULATE(
    DISTINCTCOUNT(StudentData[Day_x_Student_ID]),
    FILTER(
        StudentData,
        StudentData[Late_min] &amp;gt; SelectedThreshold
    )
)
&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 10 Jan 2025 19:20:15 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Using-numeric-range-parameter-in-a-column/m-p/4359283#M1361843</guid>
      <dc:creator>Sahir_Maharaj</dc:creator>
      <dc:date>2025-01-10T19:20:15Z</dc:date>
    </item>
    <item>
      <title>Re: Using numeric range parameter in a column</title>
      <link>https://community.fabric.microsoft.com/t5/Desktop/Using-numeric-range-parameter-in-a-column/m-p/4359423#M1361878</link>
      <description>&lt;P&gt;Thank you&amp;nbsp;&lt;SPAN&gt;FarhanJeelani,&lt;BR /&gt;I tried out a few functions you mentioned, but I have arrived at the same answer Sahir Mahara provided later, so I chose his as the answer. (You're the one that actually helped! Thank you so much!)&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 10 Jan 2025 22:32:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Desktop/Using-numeric-range-parameter-in-a-column/m-p/4359423#M1361878</guid>
      <dc:creator>tzuchiao</dc:creator>
      <dc:date>2025-01-10T22:32:36Z</dc:date>
    </item>
  </channel>
</rss>

