<?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: Using Measures to calculate a column in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2078008#M47118</link>
    <description>&lt;P&gt;Hello Daxer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your answer! I am pretty new to PBI and havent attended a course yet. So please forgive me my naive thinking &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;What do you mean by a proper date table? I have a date table&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Date = CALENDARAUTO ( )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Pretty basic but maybe proper enough? Could you maybe provide me with an example for a measure? I have created basic ones but I guess this could be a bit more complex.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards&lt;/DIV&gt;&lt;DIV&gt;KimStahl94&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Wed, 15 Sep 2021 14:46:03 GMT</pubDate>
    <dc:creator>KimStahl94</dc:creator>
    <dc:date>2021-09-15T14:46:03Z</dc:date>
    <item>
      <title>Using Measures to calculate a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2077843#M47111</link>
      <description>&lt;P&gt;Hi guys,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;After several hours of trial and error without a reasonable solution I guess it is time to get the BI community involved.&lt;/P&gt;&lt;P&gt;So I have this table called "Vacation" with different staff members in the first column and 2 more columns "Start" and "Begin" of their vacation dates.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;First, I created another table called "Dates" to visualize the number of absent people for each date. This isn't the problem. I am now trying to list the names of the absent people in a table for a selected period . So I have this slicer "date" (based on the table "Date") and I am able to pick out the selected Start and End date via two measures:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SlicerStart = FIRSTNONBLANK ( FILTERS(Dates[Date] ) , "" )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;SlicerEnd = LASTNONBLANK ( FILTERS ( Dates[Date] ) , "" )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;SPAN&gt;I thought I could use these measures within a calculated column in my table "Vacation" to evaluate if a entry is within my time period or not.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;AbsentSelectedPeriod = &lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentStart = Vacation[Beginn]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR CurrentEnd = Vacation[Ende]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR SelectedStart = [SlicerStart]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;VAR SelectedEnd = [SlicerEnd]&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;RETURN&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;IF ( SelectedStart &amp;lt;= CurrentStart &amp;amp;&amp;amp; SelectedEnd &amp;gt;= CurrentEnd , "absent within period" , BLANK () )&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;I would then use this columns to filter my table by "absent within period". This expression is just an example and would only cover vacations which start and end dates are within the selected period. There are more cases to cover but I guess my overall approach is wrong. Feel free to ask for more information due to this being my first post and I do not know how much information is needed. Thanks in advance for any tips!&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Regards&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;KimStahl94&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2021 13:18:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2077843#M47111</guid>
      <dc:creator>KimStahl94</dc:creator>
      <dc:date>2021-09-15T13:18:45Z</dc:date>
    </item>
    <item>
      <title>Re: Using Measures to calculate a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2077945#M47114</link>
      <description>&lt;P&gt;You are absolutely right. This approach is not only incorrect. It will not work at all since tables in a model are never dynamic. They are static, so once calculated, they never change (until the next refresh is requested). On top of that, using the function&amp;nbsp;&lt;SPAN&gt;FILTERS... well, I've been working with DAX for at least 6 years (hardcore development), and never had a need for this. Your values could be harvested - and in fact should be - by using the MAX and MIN functions. Your dates should always be real dates, never strings. Also, using measures to calculate columns? Not a good idea. Not only because once calculated they'll stay frozen, but also because such a practice can turn against you very quickly.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;What you really need is a proper date table and a measure that for each individual Mitarbeiter will return True or False depending on whether the condition you're talking about is met or not. Once you have such a measure, you'll be able to calculate about anything about the absenteeism... (die Urlaube, so zu sagen:).&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 14:07:29 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2077945#M47114</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T14:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: Using Measures to calculate a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2078008#M47118</link>
      <description>&lt;P&gt;Hello Daxer,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks for your answer! I am pretty new to PBI and havent attended a course yet. So please forgive me my naive thinking &lt;span class="lia-unicode-emoji" title=":grinning_face_with_smiling_eyes:"&gt;😄&lt;/span&gt;&amp;nbsp;What do you mean by a proper date table? I have a date table&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Date = CALENDARAUTO ( )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Pretty basic but maybe proper enough? Could you maybe provide me with an example for a measure? I have created basic ones but I guess this could be a bit more complex.&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;Regards&lt;/DIV&gt;&lt;DIV&gt;KimStahl94&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Wed, 15 Sep 2021 14:46:03 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2078008#M47118</guid>
      <dc:creator>KimStahl94</dc:creator>
      <dc:date>2021-09-15T14:46:03Z</dc:date>
    </item>
    <item>
      <title>Re: Using Measures to calculate a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2078078#M47121</link>
      <description>&lt;P&gt;Please study this function for instance: &lt;A href="https://dax.guide/dateadd" target="_blank"&gt;https://dax.guide/dateadd&lt;/A&gt;. It has a passage about what a proper date table is.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 15:19:16 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2078078#M47121</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T15:19:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using Measures to calculate a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2078088#M47122</link>
      <description>&lt;P&gt;By the way, the easiest way to do what you want is to have a bridge table that would join Mitarbeiter with &lt;STRONG&gt;all the&amp;nbsp; individual dates when they were absent from work&lt;/STRONG&gt;. Then, once you have it, it's dead easy to calculate for any period of time (say, day) how many of them were absent. How? Well, you'd connect your Dates to the bridge table on one field and the Mitarbeiter dimension (you have such a dimension, right?) on another and after selecting a date from Dates you'd just DISTINCTCOUNT the number of Mitarbeiter in the bridge table. Easy enough. Can't get any easier than that.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2021 15:26:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2078088#M47122</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-09-15T15:26:54Z</dc:date>
    </item>
    <item>
      <title>Re: Using Measures to calculate a column</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2094798#M47734</link>
      <description>&lt;P&gt;Hi Daxer,&lt;/P&gt;&lt;P&gt;sry for my late response, but I am only able to work on this topic once in a while. And a big thank you for your replies to my topic, I learned a lot out of them!&lt;/P&gt;&lt;P&gt;So yes, I do have a proper date table (no gaps, unique values), a Budget table as dimension table (Each employee in a different row with some further information) and a fact table with the vacation dates. My problem is that my vacation table does only provide a period defined by start, duration and end. So there are no individual absent dates which I could connect to my Employee table.&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&lt;img /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have 2 questions:&lt;BR /&gt;How do I create a table with all individual absent dates for each employee?&lt;BR /&gt;How can I create a measure returning true or false whether or not the conditions are met? Should I use the SWITCH or IF function? Could you provide an example?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance - Regards&lt;BR /&gt;KimStahl94&lt;/P&gt;</description>
      <pubDate>Thu, 23 Sep 2021 14:59:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Using-Measures-to-calculate-a-column/m-p/2094798#M47734</guid>
      <dc:creator>KimStahl94</dc:creator>
      <dc:date>2021-09-23T14:59:00Z</dc:date>
    </item>
  </channel>
</rss>

