{"id":522,"date":"2024-12-15T07:19:12","date_gmt":"2024-12-15T07:19:12","guid":{"rendered":"https:\/\/datadandies.nl\/?p=522"},"modified":"2024-12-20T09:19:54","modified_gmt":"2024-12-20T09:19:54","slug":"lazy-evaluation-in-python-and-in-dax-variables","status":"publish","type":"post","link":"https:\/\/datadandies.nl\/index.php\/2024\/12\/15\/lazy-evaluation-in-python-and-in-dax-variables\/","title":{"rendered":"Lazy evaluation in Python and in Power BI DAX variables"},"content":{"rendered":"\n<p>I remember reading about lazy evaluation for DAX variables the first time several years back in the book \u201cThe Definitive Guide to DAX\u201d from Marco Russo &amp; Alberto Ferrari. I also remember being very confused about the concept back then. It took some time and research in order to understand the concept a little better.<\/p>\n\n\n\n<p>If you find yourself struggling with understanding lazy evaluation as well, I invite you to read this post.<\/p>\n\n\n\n<p>In order to better visualize certain aspects that will assist in explaining lazy evaluation, I have chosen to use Python instead of DAX to explain the concept. At the end I will briefly get back to lazy evaluation for DAX variables.<\/p>\n\n\n\n<p>Let\u2019s start with why lazy evaluation is interesting. Imagine having a huge dataset and limited memory (which is actually always the case).<\/p>\n\n\n\n<p>You want to save values from this dataset that match a certain condition. However, you run into memory issues: you do not have enough memory in the tool you have available for computing the results.<\/p>\n\n\n\n<p>Instead of storing the results in a list, which is loaded completely into memory, you could opt for a generator object instead. A generator object only stores the metadata of the object which leads to a much smaller size. Below is an example of this:<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import sys\n\n# Create a range object\nr = range(1_000_000)\nprint(&quot;Size of range object:&quot;, sys.getsizeof(r))  # Small size, e.g., 48 bytes\n\n# Create a list from the range\nl = list(r)\nprint(&quot;Size of list object:&quot;, sys.getsizeof(l))  # Much larger size, 8.000.056 bytes\n\n# Create a generator object from the range\ng = (a for a in r)\nprint(&quot;Size of list object:&quot;, sys.getsizeof(g))  # Small size, 192 bytes\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Kopieer\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> sys<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># Create a range object<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">r <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">range<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #B48EAD\">1_000_000<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Size of range object:<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> sys<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">getsizeof<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">r<\/span><span style=\"color: #ECEFF4\">))<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #616E88\"># Small size, e.g., 48 bytes<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># Create a list from the range<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">l <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #88C0D0\">list<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">r<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Size of list object:<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> sys<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">getsizeof<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">l<\/span><span style=\"color: #ECEFF4\">))<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #616E88\"># Much larger size, 8.000.056 bytes<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># Create a generator object from the range<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">g <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">a <\/span><span style=\"color: #81A1C1\">for<\/span><span style=\"color: #D8DEE9FF\"> a <\/span><span style=\"color: #81A1C1\">in<\/span><span style=\"color: #D8DEE9FF\"> r<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #A3BE8C\">Size of list object:<\/span><span style=\"color: #ECEFF4\">&quot;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> sys<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">getsizeof<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">g<\/span><span style=\"color: #ECEFF4\">))<\/span><span style=\"color: #D8DEE9FF\">  <\/span><span style=\"color: #616E88\"># Small size, 192 bytes<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>The snippet of code below gives a more elaborate explanation of what exactly lazy evaluation does.<\/p>\n\n\n\n<div class=\"wp-block-kevinbatdorf-code-block-pro\" data-code-block-pro-font-family=\"Code-Pro-JetBrains-Mono\" style=\"font-size:.875rem;font-family:Code-Pro-JetBrains-Mono,ui-monospace,SFMono-Regular,Menlo,Monaco,Consolas,monospace;line-height:1.25rem;--cbp-tab-width:2;tab-size:var(--cbp-tab-width, 2)\"><span style=\"display:block;padding:16px 0 0 16px;margin-bottom:-1px;width:100%;text-align:left;background-color:#2e3440ff\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"54\" height=\"14\" viewBox=\"0 0 54 14\"><g fill=\"none\" fill-rule=\"evenodd\" transform=\"translate(1 1)\"><circle cx=\"6\" cy=\"6\" r=\"6\" fill=\"#FF5F56\" stroke=\"#E0443E\" stroke-width=\".5\"><\/circle><circle cx=\"26\" cy=\"6\" r=\"6\" fill=\"#FFBD2E\" stroke=\"#DEA123\" stroke-width=\".5\"><\/circle><circle cx=\"46\" cy=\"6\" r=\"6\" fill=\"#27C93F\" stroke=\"#1AAB29\" stroke-width=\".5\"><\/circle><\/g><\/svg><\/span><span role=\"button\" tabindex=\"0\" data-code=\"import re\nimport sys\n\n# So imagine you have this huge dataset containing sales and you only want to have sales with apples:\nhuge_dataset = [{1: '10 apples', 2: '3 pears', 3: '30 apples', 4: 'ad infinitum'}]\n\n# Create regex object in order to extract all values with 'apples' from the dictionary in the list below\nregex_apples = re.compile('.*apples', re.IGNORECASE)\n\n# Using list comprehension, you can filter out the apples and store them in a list:\n# Variable apples_sales stores all the filtered results in memory\napples_sales = [sale for sale in huge_dataset[0].values() if re.match(regex_apples, sale)] # re.match returns a Match object when it finds something, and returns None when nothing is found. When a match is found, a Match object will be returned and this object will be interpreted as 'truthy' in the if-statement. When there is no match, or with other words, when no Match object is returned (resulting in &quot;None&quot;), the condition wil be 'falsy' in the if-statement. \n\n# This would however, load the entire huge_dataset in memory. If you do not want abuse your memory in such a manner, you could opt for a Generator object instead. \n# Generator objects use lazy evaluation which means that they do not load the entire content of the object into memory. \n# Variable apples_sales_gen stores a Generator object which only contains the &quot;metadata&quot; in memory, meaning the condition (if-statement) and the iterable object\napples_sales_gen = (sale for sale in huge_dataset[0].values() if re.match(regex_apples, sale))\n\n# Processing only starts when you explicitly iterate over the Generator object\nprint(next(apples_sales_gen))   # Only the first item of the Generator object is printed: 10 apples\nprint(next(apples_sales_gen))   # Only the second item of the Generator object is printed: 30 apples\n\n# The list stores all the filtered results, so this will show the entire list:\nprint(apples_sales)             # All items in the list apples_sales will be printed: ['10 apples', '30 apples']\n\n# You can see the generator's object reference (it has not been consumed yet):\nprint(apples_sales_gen)         # Outputs something like: &lt;generator object &lt;genexpr&gt; at 0x0000020D2DE935A0&gt;\" style=\"color:#d8dee9ff;display:none\" aria-label=\"Kopieer\" class=\"code-block-pro-copy-button\"><svg xmlns=\"http:\/\/www.w3.org\/2000\/svg\" style=\"width:24px;height:24px\" fill=\"none\" viewBox=\"0 0 24 24\" stroke=\"currentColor\" stroke-width=\"2\"><path class=\"with-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2m-6 9l2 2 4-4\"><\/path><path class=\"without-check\" stroke-linecap=\"round\" stroke-linejoin=\"round\" d=\"M9 5H7a2 2 0 00-2 2v12a2 2 0 002 2h10a2 2 0 002-2V7a2 2 0 00-2-2h-2M9 5a2 2 0 002 2h2a2 2 0 002-2M9 5a2 2 0 012-2h2a2 2 0 012 2\"><\/path><\/svg><\/span><pre class=\"shiki nord\" style=\"background-color: #2e3440ff\" tabindex=\"0\"><code><span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> re<\/span><\/span>\n<span class=\"line\"><span style=\"color: #81A1C1\">import<\/span><span style=\"color: #D8DEE9FF\"> sys<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># So imagine you have this huge dataset containing sales and you only want to have sales with apples:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">huge_dataset <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">[{<\/span><span style=\"color: #B48EAD\">1<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">10 apples<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">2<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">3 pears<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">3<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">30 apples<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #B48EAD\">4<\/span><span style=\"color: #ECEFF4\">:<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">ad infinitum<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">}]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># Create regex object in order to extract all values with &#39;apples&#39; from the dictionary in the list below<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">regex_apples <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> re<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">compile<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #A3BE8C\">.*apples<\/span><span style=\"color: #ECEFF4\">&#39;<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> re<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #D8DEE9FF\">IGNORECASE<\/span><span style=\"color: #ECEFF4\">)<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># Using list comprehension, you can filter out the apples and store them in a list:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># Variable apples_sales stores all the filtered results in memory<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">apples_sales <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #D8DEE9FF\">sale <\/span><span style=\"color: #81A1C1\">for<\/span><span style=\"color: #D8DEE9FF\"> sale <\/span><span style=\"color: #81A1C1\">in<\/span><span style=\"color: #D8DEE9FF\"> huge_dataset<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #ECEFF4\">].<\/span><span style=\"color: #88C0D0\">values<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> re<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">match<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">regex_apples<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> sale<\/span><span style=\"color: #ECEFF4\">)]<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #616E88\"># re.match returns a Match object when it finds something, and returns None when nothing is found. When a match is found, a Match object will be returned and this object will be interpreted as &#39;truthy&#39; in the if-statement. When there is no match, or with other words, when no Match object is returned (resulting in &quot;None&quot;), the condition wil be &#39;falsy&#39; in the if-statement. <\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># This would however, load the entire huge_dataset in memory. If you do not want abuse your memory in such a manner, you could opt for a Generator object instead. <\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># Generator objects use lazy evaluation which means that they do not load the entire content of the object into memory. <\/span><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># Variable apples_sales_gen stores a Generator object which only contains the &quot;metadata&quot; in memory, meaning the condition (if-statement) and the iterable object<\/span><\/span>\n<span class=\"line\"><span style=\"color: #D8DEE9FF\">apples_sales_gen <\/span><span style=\"color: #81A1C1\">=<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">sale <\/span><span style=\"color: #81A1C1\">for<\/span><span style=\"color: #D8DEE9FF\"> sale <\/span><span style=\"color: #81A1C1\">in<\/span><span style=\"color: #D8DEE9FF\"> huge_dataset<\/span><span style=\"color: #ECEFF4\">[<\/span><span style=\"color: #B48EAD\">0<\/span><span style=\"color: #ECEFF4\">].<\/span><span style=\"color: #88C0D0\">values<\/span><span style=\"color: #ECEFF4\">()<\/span><span style=\"color: #D8DEE9FF\"> <\/span><span style=\"color: #81A1C1\">if<\/span><span style=\"color: #D8DEE9FF\"> re<\/span><span style=\"color: #ECEFF4\">.<\/span><span style=\"color: #88C0D0\">match<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">regex_apples<\/span><span style=\"color: #ECEFF4\">,<\/span><span style=\"color: #D8DEE9FF\"> sale<\/span><span style=\"color: #ECEFF4\">))<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># Processing only starts when you explicitly iterate over the Generator object<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #88C0D0\">next<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">apples_sales_gen<\/span><span style=\"color: #ECEFF4\">))<\/span><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #616E88\"># Only the first item of the Generator object is printed: 10 apples<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #88C0D0\">next<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">apples_sales_gen<\/span><span style=\"color: #ECEFF4\">))<\/span><span style=\"color: #D8DEE9FF\">   <\/span><span style=\"color: #616E88\"># Only the second item of the Generator object is printed: 30 apples<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># The list stores all the filtered results, so this will show the entire list:<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">apples_sales<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\">             <\/span><span style=\"color: #616E88\"># All items in the list apples_sales will be printed: [&#39;10 apples&#39;, &#39;30 apples&#39;]<\/span><\/span>\n<span class=\"line\"><\/span>\n<span class=\"line\"><span style=\"color: #616E88\"># You can see the generator&#39;s object reference (it has not been consumed yet):<\/span><\/span>\n<span class=\"line\"><span style=\"color: #88C0D0\">print<\/span><span style=\"color: #ECEFF4\">(<\/span><span style=\"color: #D8DEE9FF\">apples_sales_gen<\/span><span style=\"color: #ECEFF4\">)<\/span><span style=\"color: #D8DEE9FF\">         <\/span><span style=\"color: #616E88\"># Outputs something like: &lt;generator object &lt;genexpr&gt; at 0x0000020D2DE935A0&gt;<\/span><\/span><\/code><\/pre><\/div>\n\n\n\n<p>As for how to apply this knowledge to lazy evaluation and DAX variables: variables that are declared in DAX are only evaluated when used in the RETURN statement. <\/p>\n","protected":false},"excerpt":{"rendered":"<p>I remember reading about lazy evaluation for DAX variables the first time several years back in the book \u201cThe Definitive Guide to DAX\u201d from Marco Russo &amp; Alberto Ferrari. I also remember being very confused about the concept back then. It took some time and research in order to understand the concept a little better.&hellip;<\/p>\n<p class=\"more-link\"><a href=\"https:\/\/datadandies.nl\/index.php\/2024\/12\/15\/lazy-evaluation-in-python-and-in-dax-variables\/\" class=\"themebutton\">Read More<\/a><\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[1],"tags":[6,37],"class_list":["post-522","post","type-post","status-publish","format-standard","hentry","category-blog","tag-dax","tag-python"],"_links":{"self":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/522","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/comments?post=522"}],"version-history":[{"count":4,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/522\/revisions"}],"predecessor-version":[{"id":529,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/posts\/522\/revisions\/529"}],"wp:attachment":[{"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/media?parent=522"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/categories?post=522"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/datadandies.nl\/index.php\/wp-json\/wp\/v2\/tags?post=522"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}