Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
JipZonneveld
New Member

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?

JipZonneveld_0-1629189261232.png

 

Thanks!

 

Jip

 

1 ACCEPTED SOLUTION

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.

MFelix_0-1629458318957.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

5 REPLIES 5
V-pazhen-msft
Community Support
Community Support

@JipZonneveld 

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

 

Best 
Paul

MFelix
Super User
Super User

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.


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



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

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"

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.

MFelix_0-1629458318957.png

 


Regards

Miguel Félix


Did I answer your question? Mark my post as a solution!

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.