<?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: Card Visual Returning Incorrect Value in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Card-Visual-Returning-Incorrect-Value/m-p/3978289#M154250</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="698521" data-lia-user-login="villa1980" class="lia-mention lia-mention-user"&gt;villa1980&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please &lt;STRONG&gt;update&lt;/STRONG&gt; the formula of measure [Max_Date_By_Cat] as below and check if it can return the expected result...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Max_Date_By_Cat = 
VAR _tab =
    SUMMARIZE (
        FILTER ( Workplace_Incidents, Workplace_Incidents[Incident] = "Maj" ),
        Workplace_Incidents[Platform],
        Workplace_Incidents[Date of Incident]
    )
RETURN
    MAXX ( _tab, [Date of Incident] )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the above ones can't help you figure out, please&amp;nbsp;provide some&amp;nbsp;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&amp;nbsp;in your table '&lt;STRONG&gt;Workplace_Incidents&lt;/STRONG&gt;'&amp;nbsp;(&lt;EM&gt;&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;&lt;/EM&gt;) with&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;format&amp;nbsp;and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&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%7C02%7Cv-yiruan%40microsoft.com%7Cfe6489193a1b4b3b2c3108dc521fb7ce%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638475543436019904%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=v%2BEWR63B7CH%2BV5oWqwumB56nQFj9ualyOO61gu8e5SI%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;STRONG&gt;it is better&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;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;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&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=05%7C02%7Cv-yiruan%40microsoft.com%7Cfe6489193a1b4b3b2c3108dc521fb7ce%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638475543436025251%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=VsmePB5Y0qB9BNuqnghHQeZSKzaaithvIv0fLr7iulE%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 07 Jun 2024 01:49:19 GMT</pubDate>
    <dc:creator>Anonymous</dc:creator>
    <dc:date>2024-06-07T01:49:19Z</dc:date>
    <item>
      <title>Card Visual Returning Incorrect Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Card-Visual-Returning-Incorrect-Value/m-p/3977104#M154201</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;&lt;P&gt;&amp;nbsp;I have a card visual that returns the latest date when the latest accident based on a DAX expression that filters on one of 2 groups&lt;/P&gt;&lt;P&gt;Ie.&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Max_Date_By_Cat = &lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; &lt;/SPAN&gt;&lt;SPAN&gt;MAX&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Workplace_Incidents&lt;/SPAN&gt;&lt;SPAN&gt;[Date of Incident]&lt;/SPAN&gt;&lt;SPAN&gt;), &lt;/SPAN&gt;&lt;SPAN&gt;ALLEXCEPT&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Workplace_Incidents&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;Workplace_Incidents&lt;/SPAN&gt;&lt;SPAN&gt;[Platform]&lt;/SPAN&gt;&lt;SPAN&gt;)&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp; &amp;nbsp; )&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Last_Accident = &lt;/SPAN&gt;&lt;SPAN&gt;DATEDIFF&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;[Max_Date_By_Cat]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;TODAY&lt;/SPAN&gt;&lt;SPAN&gt;(),&lt;/SPAN&gt;&lt;SPAN&gt;DAY&lt;/SPAN&gt;&lt;SPAN&gt;)+&lt;/SPAN&gt;&lt;SPAN&gt;0&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;This works fine, however, I want it filter then on whether the incident was "Maj" and bring back the Last_Accident. But when I add that to the filter it returns the wrong value.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;&amp;nbsp;As there have been no Incidents that are classed as "Maj"this month by either platform, the total should show show 0 but it is showing 1.&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Any ideas&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Thanks&lt;BR /&gt;&lt;BR /&gt;Alex&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 06 Jun 2024 12:51:13 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Card-Visual-Returning-Incorrect-Value/m-p/3977104#M154201</guid>
      <dc:creator>villa1980</dc:creator>
      <dc:date>2024-06-06T12:51:13Z</dc:date>
    </item>
    <item>
      <title>Re: Card Visual Returning Incorrect Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Card-Visual-Returning-Incorrect-Value/m-p/3978289#M154250</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="698521" data-lia-user-login="villa1980" class="lia-mention lia-mention-user"&gt;villa1980&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;Please &lt;STRONG&gt;update&lt;/STRONG&gt; the formula of measure [Max_Date_By_Cat] as below and check if it can return the expected result...&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;Max_Date_By_Cat = 
VAR _tab =
    SUMMARIZE (
        FILTER ( Workplace_Incidents, Workplace_Incidents[Incident] = "Maj" ),
        Workplace_Incidents[Platform],
        Workplace_Incidents[Date of Incident]
    )
RETURN
    MAXX ( _tab, [Date of Incident] )&lt;/LI-CODE&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;If the above ones can't help you figure out, please&amp;nbsp;provide some&amp;nbsp;&lt;STRONG&gt;raw data&lt;/STRONG&gt;&amp;nbsp;in your table '&lt;STRONG&gt;Workplace_Incidents&lt;/STRONG&gt;'&amp;nbsp;(&lt;EM&gt;&lt;STRONG&gt;exclude&amp;nbsp;sensitive&amp;nbsp;data&lt;/STRONG&gt;&lt;/EM&gt;) with&amp;nbsp;&lt;FONT color="#FF0000"&gt;&lt;STRONG&gt;Text&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;format&amp;nbsp;and your&amp;nbsp;&lt;STRONG&gt;expected result&lt;/STRONG&gt;&amp;nbsp;with backend logic and special examples. It would be helpful to find out the solution. You can refer the following link to share the required info:&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&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%7C02%7Cv-yiruan%40microsoft.com%7Cfe6489193a1b4b3b2c3108dc521fb7ce%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638475543436019904%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=v%2BEWR63B7CH%2BV5oWqwumB56nQFj9ualyOO61gu8e5SI%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to provide sample data in the Power BI Forum&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;And&lt;FONT color="#FF0000"&gt;&amp;nbsp;&lt;STRONG&gt;it is better&lt;/STRONG&gt;&amp;nbsp;&lt;/FONT&gt;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;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&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=05%7C02%7Cv-yiruan%40microsoft.com%7Cfe6489193a1b4b3b2c3108dc521fb7ce%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638475543436025251%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=VsmePB5Y0qB9BNuqnghHQeZSKzaaithvIv0fLr7iulE%3D&amp;amp;reserved=0" target="_blank" rel="noopener nofollow noreferrer"&gt;How to upload PBI in Community&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;Best Regards&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 01:49:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Card-Visual-Returning-Incorrect-Value/m-p/3978289#M154250</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-06-07T01:49:19Z</dc:date>
    </item>
    <item>
      <title>Re: Card Visual Returning Incorrect Value</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Card-Visual-Returning-Incorrect-Value/m-p/3979179#M154285</link>
      <description>&lt;P&gt;Hi v-yiruan-msft,&lt;BR /&gt;What can I say, that has worked so well thank-you so much, took a while to understand what is going on with the expression but makes sense now....I should look at using VAR in the future when looking at these kind of expressions.&lt;/P&gt;&lt;P&gt;Many Thanks Again&lt;/P&gt;&lt;P&gt;Alex&lt;/P&gt;</description>
      <pubDate>Fri, 07 Jun 2024 08:54:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Card-Visual-Returning-Incorrect-Value/m-p/3979179#M154285</guid>
      <dc:creator>villa1980</dc:creator>
      <dc:date>2024-06-07T08:54:47Z</dc:date>
    </item>
  </channel>
</rss>

