<?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: Variable column depending on filters in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3175340#M114609</link>
    <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, it seems that you want to create a calculated column with the statuses and the value will be changed dynamically base on filters. &lt;FONT color="#FF0000"&gt;But&lt;/FONT&gt; the &lt;STRONG&gt;calculated column&amp;nbsp;&lt;/STRONG&gt;is computed during data refresh and uses the current row as a context, it&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;will not&lt;/STRONG&gt; &lt;/FONT&gt;change according to the user interaction(slicer, filter, column selections etc.) in the report... You need to create a measure to replace it. Please review the following links about the difference of calculated column and measure.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://nam06.safelinks.protection.outlook.com/?url=https%3a%2f%2fwww.sqlbi.com%2farticles%2fcalculated-columns-and-measures-in-dax%2f&amp;amp;data=04%7c01%7cv-yiruan%40microsoft.com%7c6c82a3be2f13483c8c8408d9625c1586%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.sqlbi.com%2Farticles%2Fcalculated-columns-and-measures-in-dax%2F&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C13d9535082264cac3ed308daf840226e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638095251635348107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=NhZil25ltFLmuYz0siHLvkmZQlODZIoVU%2BeoJtNlpU8%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;Calculated Columns and Measures in DAX&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://nam06.safelinks.protection.outlook.com/?url=https%3a%2f%2finsightsoftware.com%2fblog%2fcalculated-columns-vs-measures%2f&amp;amp;data=04%7c01%7cv-yiruan%40microsoft.com%7c6c82a3be2f13483c8c8408d9625c1586%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c637648" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Finsightsoftware.com%2Fblog%2Fcalculated-columns-vs-measures%2F&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C13d9535082264cac3ed308daf840226e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638095251635348107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=zAy0rFzzASlQvJMQp8nY8J4oIPgdJTTal7VeZgde0ho%3D&amp;amp;reserved=0" target="_blank" rel="noopener" aria-label="Link Calculated Columns vs Measures"&gt;Calculated Columns vs Measures&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In addition, you can&amp;nbsp;provide some&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in your tables&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;) with&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;format&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and your&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;with backend logic and special examples. Later I will check it and check if there is any workaround to achieve the same requirement. You can refer the following links to share the required info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7UEf71Mu2ySWC7MlgciaPViM1RqU5nx4OHGHG5EvNSw%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
    <pubDate>Thu, 06 Apr 2023 07:02:00 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2023-04-06T07:02:00Z</dc:date>
    <item>
      <title>Variable column depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3172304#M114383</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I want to calculate statuses on columns depending on filters applied in the model. The reason why I cannot make it in measures is because it wouldnt work in the segmentation visual.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here are two examples of what I need:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Verify if a line of info contains the last date of visit of each name of store. If it is the last date then yes else no. This will change if we select different dates, so I would want the expression to be evaluated everytime I select different filters (not only date but all filters in the model).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Evalutate clusters: Make it Client A if it has sold more than XXX$ in the last 5 months, B if has at least one purchase order in the last month and has not sold more than&amp;nbsp;XXX$ in the last 5 months. Again, this will be different depending on the date selected.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would appreciate some help, thank you all in advance!!&lt;/P&gt;</description>
      <pubDate>Tue, 04 Apr 2023 17:12:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3172304#M114383</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-04T17:12:37Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3175340#M114609</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;According to your description, it seems that you want to create a calculated column with the statuses and the value will be changed dynamically base on filters. &lt;FONT color="#FF0000"&gt;But&lt;/FONT&gt; the &lt;STRONG&gt;calculated column&amp;nbsp;&lt;/STRONG&gt;is computed during data refresh and uses the current row as a context, it&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;will not&lt;/STRONG&gt; &lt;/FONT&gt;change according to the user interaction(slicer, filter, column selections etc.) in the report... You need to create a measure to replace it. Please review the following links about the difference of calculated column and measure.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://nam06.safelinks.protection.outlook.com/?url=https%3a%2f%2fwww.sqlbi.com%2farticles%2fcalculated-columns-and-measures-in-dax%2f&amp;amp;data=04%7c01%7cv-yiruan%40microsoft.com%7c6c82a3be2f13483c8c8408d9625c1586%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.sqlbi.com%2Farticles%2Fcalculated-columns-and-measures-in-dax%2F&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C13d9535082264cac3ed308daf840226e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638095251635348107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=NhZil25ltFLmuYz0siHLvkmZQlODZIoVU%2BeoJtNlpU8%3D&amp;amp;reserved=0" target="_blank" rel="noopener"&gt;Calculated Columns and Measures in DAX&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&lt;A title="https://nam06.safelinks.protection.outlook.com/?url=https%3a%2f%2finsightsoftware.com%2fblog%2fcalculated-columns-vs-measures%2f&amp;amp;data=04%7c01%7cv-yiruan%40microsoft.com%7c6c82a3be2f13483c8c8408d9625c1586%7c72f988bf86f141af91ab2d7cd011db47%7c1%7c0%7c637648" href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Finsightsoftware.com%2Fblog%2Fcalculated-columns-vs-measures%2F&amp;amp;data=05%7C01%7Cv-yiruan%40microsoft.com%7C13d9535082264cac3ed308daf840226e%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638095251635348107%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=zAy0rFzzASlQvJMQp8nY8J4oIPgdJTTal7VeZgde0ho%3D&amp;amp;reserved=0" target="_blank" rel="noopener" aria-label="Link Calculated Columns vs Measures"&gt;Calculated Columns vs Measures&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;In addition, you can&amp;nbsp;provide some&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;in your tables&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;STRONG&gt;&lt;EM&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/EM&gt;&lt;/STRONG&gt;&lt;SPAN&gt;) with&amp;nbsp;&lt;/SPAN&gt;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;&lt;SPAN&gt;format&amp;nbsp;&lt;/SPAN&gt;&lt;SPAN&gt;and your&amp;nbsp;&lt;/SPAN&gt;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&lt;SPAN&gt;&amp;nbsp;with backend logic and special examples. Later I will check it and check if there is any workaround to achieve the same requirement. You can refer the following links to share the required info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-provide-sample-data-in-the-Power-BI-Forum%2Fba-p%2F963216&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=EJlYfclgtrjgAEYj9Uo1AauqxaQm3hlQsjJMo4zCY1M%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FCommunity-Blog%2FHow-to-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C01%7CClaire.Dong%40microsoft.com%7Cada9149bd91546a8432508dacd31ef9b%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638047911607737134%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C3000%7C%7C%7C&amp;amp;sdata=7UEf71Mu2ySWC7MlgciaPViM1RqU5nx4OHGHG5EvNSw%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;And&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;It is better&lt;/STRONG&gt;&lt;/FONT&gt;&amp;nbsp;if you can share a&amp;nbsp;&lt;FONT color="#008000"&gt;&lt;STRONG&gt;simplified&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;pbix file. You can refer the following link to upload the file to the community. Thank you.&lt;/P&gt;
&lt;P&gt;&lt;A href="https://nam06.safelinks.protection.outlook.com/?url=https%3A%2F%2Fcommunity.powerbi.com%2Ft5%2FDesktop%2FHow-to-upload-PBI-in-Community%2Fm-p%2F1672886&amp;amp;data=04%7C01%7Cv-yiruan%40microsoft.com%7C4f580813734d4a8355b008da16f6e91a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C637847547341062885%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C1000&amp;amp;sdata=YJvujige2YITXKbKED9JieQm5LBdf%2F3IYPM4ggdiijQ%3D&amp;amp;reserved=0" target="_blank" rel="nofollow noopener noreferrer"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Thu, 06 Apr 2023 07:02:00 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3175340#M114609</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-06T07:02:00Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3179638#M114915</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I suspected it wont be possible to adress this question with calculated columns, but wasnt 100% aware of how they work so thanks a lot.&lt;BR /&gt;&lt;BR /&gt;Now, lets try a workaround with measures then. Ideally I would need them to work in the segmentation visual, so the final data viewers could filter Cluster and Last visit according to their needs, but the closest possible to this would help as well.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have provided sample raw data here:&amp;nbsp;&lt;A href="https://we.tl/t-mPMX9p69gP" target="_blank" rel="noopener"&gt;https://we.tl/t-mPMX9p69gP&lt;/A&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;I have no idea where to start in measures to calculate this, but I will try to be specific in what to expect:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last visit filter: Normally we evaluate the presence of our products in a number of shops. So, it is usefull to have the number of centers with our products in the last date we checked. I could solve it making a measure that selects lastdate of each center, but what I need is the possibility to have the same visuals calculating presence-related measures and a possibility to filter "Is it last visit? Yes/No, this will depend on date selected.&lt;BR /&gt;&lt;SPAN&gt;&lt;BR /&gt;example: if we select all the dates of the following table, Presence with "Is it last visit?= Yes" will add up to 2. Contrary to that, "Is it last visit= Yes and No" filter, the result will be 5.&lt;BR /&gt;&lt;BR /&gt;Shop//Date of visit(DD/MM/YYYY)//Presence of our product&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center A&lt;/TD&gt;&lt;TD&gt;01/01/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center B&lt;/TD&gt;&lt;TD&gt;02/01/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center C&lt;/TD&gt;&lt;TD&gt;04/01/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center D&lt;/TD&gt;&lt;TD&gt;15/01/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center B&lt;/TD&gt;&lt;TD&gt;02/02/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center B&lt;/TD&gt;&lt;TD&gt;04/02/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center A&lt;/TD&gt;&lt;TD&gt;08/02/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center C&lt;/TD&gt;&lt;TD&gt;09/02/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center D&lt;/TD&gt;&lt;TD&gt;02/02/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center A&lt;/TD&gt;&lt;TD&gt;10/02/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The problem is similar in the second case I explain to evaluate Clusters. A segmentation visual will be helpful to filter by cluster, but in time, cluster changes according to conditions set in the model, so I would love to evaluate this depending, most of all, on date.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Let me know if more details are needed, and thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 10 Apr 2023 09:17:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3179638#M114915</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-10T09:17:56Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3181047#M114997</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;As checked the sample data and pbix file which you provided, I'm not very clear about your requirement. Do you want to get the count of shop which satisfy the following requirement?&lt;/P&gt;
&lt;UL&gt;
&lt;LI&gt;&lt;SPAN&gt;[Presence of our product] is "Yes"&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;Is it last visit?= Yes or No&lt;/SPAN&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;SPAN&gt;In selected date period&lt;/SPAN&gt;&lt;/LI&gt;
&lt;/UL&gt;
&lt;P&gt;But how can we identify whether that is last visit or not? And could you please explain why the result will be 2 when&amp;nbsp;&lt;SPAN&gt;&lt;FONT size="3"&gt; "&lt;STRONG&gt;&lt;EM&gt;Is it last visit?= Yes&lt;/EM&gt;&lt;/STRONG&gt;"&lt;/FONT&gt;&lt;/SPAN&gt;&amp;nbsp;base on the below sample data?&lt;/P&gt;
&lt;BLOCKQUOTE&gt;&lt;SPAN&gt;&lt;FONT size="3"&gt;example: if we select all the dates of the following table, Presence with "Is it last visit?= Yes" will add up to 2. Contrary to that, "Is it last visit= Yes and No" filter, the result will be 5.&lt;/FONT&gt;&lt;BR /&gt;&lt;BR /&gt;Shop//Date of visit(DD/MM/YYYY)//Presence of our product&lt;/SPAN&gt;
&lt;TABLE&gt;
&lt;TBODY&gt;
&lt;TR&gt;
&lt;TD&gt;Center A&lt;/TD&gt;
&lt;TD&gt;01/01/2023&lt;/TD&gt;
&lt;TD&gt;YES&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Center B&lt;/TD&gt;
&lt;TD&gt;02/01/2023&lt;/TD&gt;
&lt;TD&gt;NO&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Center C&lt;/TD&gt;
&lt;TD&gt;04/01/2023&lt;/TD&gt;
&lt;TD&gt;YES&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Center D&lt;/TD&gt;
&lt;TD&gt;15/01/2023&lt;/TD&gt;
&lt;TD&gt;NO&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Center B&lt;/TD&gt;
&lt;TD&gt;02/02/2023&lt;/TD&gt;
&lt;TD&gt;YES&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Center B&lt;/TD&gt;
&lt;TD&gt;04/02/2023&lt;/TD&gt;
&lt;TD&gt;YES&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Center A&lt;/TD&gt;
&lt;TD&gt;08/02/2023&lt;/TD&gt;
&lt;TD&gt;NO&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Center C&lt;/TD&gt;
&lt;TD&gt;09/02/2023&lt;/TD&gt;
&lt;TD&gt;NO&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Center D&lt;/TD&gt;
&lt;TD&gt;02/02/2023&lt;/TD&gt;
&lt;TD&gt;NO&lt;/TD&gt;
&lt;/TR&gt;
&lt;TR&gt;
&lt;TD&gt;Center A&lt;/TD&gt;
&lt;TD&gt;10/02/2023&lt;/TD&gt;
&lt;TD&gt;YES&lt;/TD&gt;
&lt;/TR&gt;
&lt;/TBODY&gt;
&lt;/TABLE&gt;
&lt;HR /&gt;&lt;/BLOCKQUOTE&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 05:52:20 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3181047#M114997</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-11T05:52:20Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3181730#M115051</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Last visit stands for last visit to a specific center. For instance, if date threshold is from 01/01/2023 to 10/02/2023, lines with last visit will be:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Shop//Date of visit(DD/MM/YYYY)//Presence of our product // is it last visit?&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center A&lt;/TD&gt;&lt;TD&gt;01/01/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;No last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center B&lt;/TD&gt;&lt;TD&gt;02/01/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;No last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center C&lt;/TD&gt;&lt;TD&gt;04/01/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;No last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center D&lt;/TD&gt;&lt;TD&gt;15/01/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;No last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center B&lt;/TD&gt;&lt;TD&gt;02/02/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;No last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center B&lt;/TD&gt;&lt;TD&gt;04/02/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;Last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center A&lt;/TD&gt;&lt;TD&gt;08/02/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;No last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center C&lt;/TD&gt;&lt;TD&gt;09/02/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;Last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center D&lt;/TD&gt;&lt;TD&gt;02/02/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;Last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center A&lt;/TD&gt;&lt;TD&gt;10/02/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;Last&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;just to clear this, if we selected date from 01/01/2023 to 31/01/2023, the resulting table would be:&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Shop//Date of visit(DD/MM/YYYY)//Presence of our product // is it last visit?&lt;/SPAN&gt;&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;Center A&lt;/TD&gt;&lt;TD&gt;01/01/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;Last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center B&lt;/TD&gt;&lt;TD&gt;02/01/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;Last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center C&lt;/TD&gt;&lt;TD&gt;04/01/2023&lt;/TD&gt;&lt;TD&gt;YES&lt;/TD&gt;&lt;TD&gt;Last&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;Center D&lt;/TD&gt;&lt;TD&gt;15/01/2023&lt;/TD&gt;&lt;TD&gt;NO&lt;/TD&gt;&lt;TD&gt;Last&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Hope it clarifies,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 Apr 2023 12:04:36 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3181730#M115051</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-11T12:04:36Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3183327#M115149</link>
      <description>&lt;P&gt;Hi&amp;nbsp;Anonymous&lt;/LI-USER&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;I &lt;FONT color="#008000"&gt;&lt;STRONG&gt;updated&lt;/STRONG&gt; &lt;/FONT&gt;your sample pbix file(see the attachment), please find the details in new created page [&lt;STRONG&gt;Page 2&lt;/STRONG&gt;]. You can follow the steps below to get it:&lt;/P&gt;
&lt;P&gt;1. &lt;STRONG&gt;Update&lt;/STRONG&gt; the formula of measure &lt;STRONG&gt;[Last visit filter]&lt;/STRONG&gt; as below&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Last visit filter = 
VAR _mindate =
    MIN ( 'CALENDAR'[Date] )
VAR _maxdate =
    MAX ( 'CALENDAR'[Date] )
VAR _selshop =
    SELECTEDVALUE ( 'Date of visit'[Shop] )
VAR _selvisitdate =
    SELECTEDVALUE ( 'Date of visit'[Date of visit] )
VAR _lastvisitdate =
    CALCULATE (
        MAX ( 'Date of visit'[Date of visit] ),
        FILTER ( ALLSELECTED ( 'Date of visit' ), 'Date of visit'[Shop] = _selshop )
    )
RETURN
    IF (
        _selvisitdate &amp;lt; _mindate
            || _selvisitdate &amp;gt; _maxdate,
        BLANK (),
        IF (
            _selvisitdate = _lastvisitdate
                &amp;amp;&amp;amp; _selvisitdate &amp;gt;= _mindate
                &amp;amp;&amp;amp; _selvisitdate &amp;lt;= _maxdate,
            "Y",
            "N"
        )
    )&lt;/LI-CODE&gt;
&lt;P&gt;2. Create a dimension table as below&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;3. &lt;STRONG&gt;Update&lt;/STRONG&gt; the formula of measure [Presence Yes] as below&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Presence Yes = 
VAR _filter = [Last visit filter]
VAR _tab =
    SUMMARIZE (
        'Date of visit',
        'Date of visit'[Shop],
        'Date of visit'[Date of visit],
        'Date of visit'[Presence of our product],
        "@lastvisit", _filter
    )
RETURN
    COUNTX (
        FILTER (
            _tab,
            [@lastvisit]
                IN ALLSELECTED ( 'Last Visit'[Last Visit] )
                    &amp;amp;&amp;amp; [Presence of our product] = "Yes"
        ),
        [Date of visit]
    )&lt;/LI-CODE&gt;
&lt;P&gt;4. Create a measure as below and put it onto the column chart to &lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;replace&lt;/STRONG&gt; &lt;/FONT&gt;the measure [Presence Yes]&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Measure = 
SUMX (
    GROUPBY (
        'Date of visit',
        'Date of visit'[Shop],
        'Date of visit'[Date of visit]
    ),
    [Presence Yes]
)&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;</description>
      <pubDate>Wed, 12 Apr 2023 06:40:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3183327#M115149</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-12T06:40:25Z</dc:date>
    </item>
    <item>
      <title>Re: Variable column depending on filters</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3191794#M115769</link>
      <description>&lt;P&gt;Thanks, it worked perfectly&lt;/P&gt;</description>
      <pubDate>Mon, 17 Apr 2023 14:45:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Variable-column-depending-on-filters/m-p/3191794#M115769</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2023-04-17T14:45:24Z</dc:date>
    </item>
  </channel>
</rss>

