Forum Discussion

JipZonneveld's avatar
JipZonneveld
New Member
5 years ago
Solved

Stacked area graph missing legend values

Hello,

 

I have created a stacked area chart including nonconformity's with the change of statusses over time. However, some statusses are not present at certain times. For instance, a nonconformity can change from concept to accepted, so concept is not any longer present in the dataset. Is it possible to show the concept status as 0 in the stacked area chart, instead of having it dissapear and create a not very readable and understandable graph?

 

Thanks!

 

Jip

 

  • MFelix's avatar
    MFelix
    5 years ago

    Hi JipZonneveld ,

     

    The issue is that using the same table context to calculate you value the status you are looking for does not exist in this case when you pick up your table and filter out the status concept on the 2/1/2021 the line is simply not there so it cannot return zero.

     

    In this case create a disconnecte table with the status and then make the following measure:

    Countof Status = 
    
    CALCULATE(COUNT('Table'[NCF]), FILTER(ALL('Table'[status]), 'Table'[status] = MAX('Status'[status])))+0

    Result below and in attach PBIX file.

     

5 Replies

  • Hi JipZonneveld ,

     

    How is your data setup? are you using the columns on your data or a measure? and the date is it part of your table or is it a calendar table?

     

    If you are using a measure you can do a coalesce or a +0 to add the 0 values when there are no readings however this will not work if your date column is within the same table of your measure.

    • JipZonneveld's avatar
      JipZonneveld
      New Member

      Hi miguel Felix,

       

      I am only using columns. The date is loaded each day in the table, including the status (which is changing) and the load date. I also do have a calendar table but in this graph the date (load date of the nonconformity) is used.  

       

      Greetings,

       

      Jip

      • JipZonneveld's avatar
        JipZonneveld
        New Member

        So for instance the table looks something like this:

         

        Load date        NCF           status     
        1/1/2021         NCF1         concept

        1/1/2021         NCF2         actual

        1/1/2021         NCF3         actual

        2/1/2021         NCF1         actual

        2/1/2021         NCF2         actual

        2/1/2021         NCF3         actual

        so on load date 2/1/2021 the status concept is "missing"

  • Anonymous's avatar
    Anonymous
    Not applicable

    JipZonneveld 

    I somehow cannot reproduce the graph like your, can you share the sample in pbix. Thank you.

     

    Best 
    Paul