<?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: Line chart not showing data point as 0 when measure = null in DAX Commands and Tips</title>
    <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Line-chart-not-showing-data-point-as-0-when-measure-null/m-p/3703189#M144027</link>
    <description>&lt;P&gt;To ensure that your line chart displays data points for weeks with zero values for CNF no TECO, you can adjust your DAX measure and your data model. Here's how you can do it:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Adjust the DAX Measure&lt;/STRONG&gt;: You need to ensure that your measure returns zero instead of null when there are no CNF rows without TECO. You can achieve this by using the IF function. Here's how you can adjust your measure:&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;CNF no TECO =&lt;BR /&gt;VAR CNF_No_TECO_Count = CALCULATE(COUNTROWS(Table), FILTER(Table, SEARCH("TECO",[Column],,0)=0))&lt;BR /&gt;RETURN&lt;BR /&gt;IF(ISBLANK(CNF_No_TECO_Count), 0, CNF_No_TECO_Count)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;This measure checks if the count of CNF rows without TECO is blank. If it is blank, it returns 0; otherwise, it returns the count.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Ensure Proper Data Model Relationship&lt;/STRONG&gt;: Ensure that your date table is properly related to your data table. Make sure you have a date column in your date table that represents the week start date (Actual Finish - WEEKDAY(Actual Finish, 2) + 1), and it should be related to the date column in your data table.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Set Up the Line Chart&lt;/STRONG&gt;: Once you've adjusted your measure and ensured proper relationships in your data model, create a line chart with the following settings:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;X-axis: Use the week start date from your date table.&lt;/LI&gt;&lt;LI&gt;Y-axis: Use the CNF no TECO measure you just created.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;With these adjustments, your line chart should now display data points for weeks with zero values for CNF no TECO, and it should plot data points on a weekly basis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
    <pubDate>Fri, 16 Feb 2024 06:14:24 GMT</pubDate>
    <dc:creator>123abc</dc:creator>
    <dc:date>2024-02-16T06:14:24Z</dc:date>
    <item>
      <title>Line chart not showing data point as 0 when measure = null</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Line-chart-not-showing-data-point-as-0-when-measure-null/m-p/3702201#M143986</link>
      <description>&lt;P&gt;I am trying to create a line chart showing the number of rows that include CNF but not TECO using the following measure as the y axis:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;CNF no TECO =&lt;/SPAN&gt;&lt;SPAN&gt; (&lt;/SPAN&gt;&lt;SPAN&gt;CALCULATE&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;COUNTROWS(Table&lt;/SPAN&gt;&lt;SPAN&gt;), (&lt;/SPAN&gt;&lt;SPAN&gt;FILTER&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;Table&lt;/SPAN&gt;&lt;SPAN&gt;, &lt;/SPAN&gt;&lt;SPAN&gt;SEARCH&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;"TECO"&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;[Column]&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;0&lt;/SPAN&gt;&lt;SPAN&gt;))))&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;The x-axis shows the date, all the rows are associated to various dates but I am trying to graph the data as a weekly report so I created a column within my table that I connected to a separate data table using the following measure:&lt;/SPAN&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;Week &lt;/SPAN&gt;&lt;SPAN&gt;Start&lt;/SPAN&gt;&lt;SPAN&gt; Date =&lt;/SPAN&gt; &lt;SPAN&gt;'Costs'&lt;/SPAN&gt;&lt;SPAN&gt;[Actual Finish]&lt;/SPAN&gt;&lt;SPAN&gt; - &lt;/SPAN&gt;&lt;SPAN&gt;WEEKDAY&lt;/SPAN&gt;&lt;SPAN&gt;(&lt;/SPAN&gt;&lt;SPAN&gt;'Costs'&lt;/SPAN&gt;&lt;SPAN&gt;[Actual Finish]&lt;/SPAN&gt;&lt;SPAN&gt;,&lt;/SPAN&gt;&lt;SPAN&gt;2&lt;/SPAN&gt;&lt;SPAN&gt;) + &lt;/SPAN&gt;&lt;SPAN&gt;1&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, for certain weeks there will be 0 CNF with no TECO rows and that is not being reflected on my table (considering that this data ranges from Dec 11 2023 to Jan 15 2023):&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have tried adding +0 at the end of the measure for my y-axis but that then gives me a chart with daily data points instead of weekly:&lt;/P&gt;&lt;img /&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like my line chart to show my data points week by week and not day by day as shown above, while still plotting data points as zero when the result of the measure is null. I have tried the "Show items with no data" option with the x-axis with no success. What am I missing? Am I using the wrong measures?&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;/DIV&gt;&lt;DIV&gt;&amp;nbsp;&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Thu, 15 Feb 2024 19:19:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Line-chart-not-showing-data-point-as-0-when-measure-null/m-p/3702201#M143986</guid>
      <dc:creator>elambs</dc:creator>
      <dc:date>2024-02-15T19:19:25Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart not showing data point as 0 when measure = null</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Line-chart-not-showing-data-point-as-0-when-measure-null/m-p/3703189#M144027</link>
      <description>&lt;P&gt;To ensure that your line chart displays data points for weeks with zero values for CNF no TECO, you can adjust your DAX measure and your data model. Here's how you can do it:&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Adjust the DAX Measure&lt;/STRONG&gt;: You need to ensure that your measure returns zero instead of null when there are no CNF rows without TECO. You can achieve this by using the IF function. Here's how you can adjust your measure:&lt;/P&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;CNF no TECO =&lt;BR /&gt;VAR CNF_No_TECO_Count = CALCULATE(COUNTROWS(Table), FILTER(Table, SEARCH("TECO",[Column],,0)=0))&lt;BR /&gt;RETURN&lt;BR /&gt;IF(ISBLANK(CNF_No_TECO_Count), 0, CNF_No_TECO_Count)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;&lt;P&gt;This measure checks if the count of CNF rows without TECO is blank. If it is blank, it returns 0; otherwise, it returns the count.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Ensure Proper Data Model Relationship&lt;/STRONG&gt;: Ensure that your date table is properly related to your data table. Make sure you have a date column in your date table that represents the week start date (Actual Finish - WEEKDAY(Actual Finish, 2) + 1), and it should be related to the date column in your data table.&lt;/P&gt;&lt;/LI&gt;&lt;LI&gt;&lt;P&gt;&lt;STRONG&gt;Set Up the Line Chart&lt;/STRONG&gt;: Once you've adjusted your measure and ensured proper relationships in your data model, create a line chart with the following settings:&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;X-axis: Use the week start date from your date table.&lt;/LI&gt;&lt;LI&gt;Y-axis: Use the CNF no TECO measure you just created.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;With these adjustments, your line chart should now display data points for weeks with zero values for CNF no TECO, and it should plot data points on a weekly basis.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;If this post&amp;nbsp;helps, then please consider&amp;nbsp;Accepting it as the solution&amp;nbsp;to help the other members find it more quickly.&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&amp;nbsp;&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;In case there is still a problem, please feel free and explain your issue in detail,&amp;nbsp;It will be my pleasure to assist you in any way I can.&lt;/STRONG&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 06:14:24 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Line-chart-not-showing-data-point-as-0-when-measure-null/m-p/3703189#M144027</guid>
      <dc:creator>123abc</dc:creator>
      <dc:date>2024-02-16T06:14:24Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart not showing data point as 0 when measure = null</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Line-chart-not-showing-data-point-as-0-when-measure-null/m-p/3703209#M144032</link>
      <description>&lt;P&gt;Hi,&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="690973" data-lia-user-login="elambs" class="lia-mention lia-mention-user"&gt;elambs&lt;/a&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;You can try creating a separate table that contains all the weeks in the date range you're interested in, and then use the measure to calculate the number of rows for each week in the original table and meet the criteria for including CNF but not TECO. This way, even if there are no rows in the original table that match the criteria for a given week, the corresponding data point in the chart will still be plotted as 0.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Maybe you will be able to provide some sample data or PBIX files. And don't give away your private information.&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&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-Get-Your-Question-Answered-Quickly%2Fba-p%2F38490&amp;amp;data=05%7C02%7Cv-yohua%40microsoft.com%7Cab284d93b8964569ccff08dc2eb88d6a%7C72f988bf86f141af91ab2d7cd011db47%7C1%7C0%7C638436617396608716%7CUnknown%7CTWFpbGZsb3d8eyJWIjoiMC4wLjAwMDAiLCJQIjoiV2luMzIiLCJBTiI6Ik1haWwiLCJXVCI6Mn0%3D%7C0%7C%7C%7C&amp;amp;sdata=iW63BdiV6We2%2FHyLwWZss4q4D%2FmfJCHY2jgBafxfTvY%3D&amp;amp;reserved=0" target="_blank"&gt;How to Get Your Question Answered Quickly&lt;/A&gt;&lt;/SPAN&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards&lt;/P&gt;
&lt;P&gt;Yongkang Hua&lt;/P&gt;
&lt;P&gt;If this post&amp;nbsp;&lt;STRONG&gt;helps&lt;/STRONG&gt;, then please consider&amp;nbsp;&lt;STRONG&gt;Accept it as the solution&lt;/STRONG&gt;&amp;nbsp;to help the other members find it more quickly.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 06:29:49 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Line-chart-not-showing-data-point-as-0-when-measure-null/m-p/3703209#M144032</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-02-16T06:29:49Z</dc:date>
    </item>
    <item>
      <title>Re: Line chart not showing data point as 0 when measure = null</title>
      <link>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Line-chart-not-showing-data-point-as-0-when-measure-null/m-p/3704017#M144075</link>
      <description>&lt;P&gt;This worked great! Thank you so much for your reply&lt;/P&gt;</description>
      <pubDate>Fri, 16 Feb 2024 12:54:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/DAX-Commands-and-Tips/Line-chart-not-showing-data-point-as-0-when-measure-null/m-p/3704017#M144075</guid>
      <dc:creator>elambs</dc:creator>
      <dc:date>2024-02-16T12:54:02Z</dc:date>
    </item>
  </channel>
</rss>

