Forum Discussion

elambs's avatar
elambs
Frequent Visitor
2 years ago
Solved

Line chart not showing data point as 0 when measure = null

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:   CNF no TECO = (CALCULATE(COUNTROWS(Table), (FILTER(Table, S...
  • 123abc's avatar
    2 years ago

    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:

    1. Adjust the DAX Measure: 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:

    CNF no TECO =
    VAR CNF_No_TECO_Count = CALCULATE(COUNTROWS(Table), FILTER(Table, SEARCH("TECO",[Column],,0)=0))
    RETURN
    IF(ISBLANK(CNF_No_TECO_Count), 0, CNF_No_TECO_Count)

     

    1. 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.

    2. Ensure Proper Data Model Relationship: 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.

    3. Set Up the Line Chart: Once you've adjusted your measure and ensured proper relationships in your data model, create a line chart with the following settings:

      • X-axis: Use the week start date from your date table.
      • Y-axis: Use the CNF no TECO measure you just created.

    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.

     

    If this post helps, then please consider Accepting it as the solution to help the other members find it more quickly.

     

    In case there is still a problem, please feel free and explain your issue in detail, It will be my pleasure to assist you in any way I can.