简体   繁体   中英

Show graph with no value in Power BI

I have data in a column which can have only two values - Staff or Temporary

Right now I have only one entry as shown below -

在此处输入图像描述

I need to show this in a bar chart with their count as values on Y - axis.

When I plot it, It shows only Staff with its value because there is only Staff entered in the column as shown in graph - 在此处输入图像描述

But I need to show both the category on X-axis with Staff and Temporary mentioned and their Count on Y-axis as 70 and 0.

Is there anyway to do it?

Thanks.

What would be best in this situation is to create a lookup table that you can use in a relationship. In this example you have the following two tables:

Some Employee Data

在此处输入图像描述

Employee Type

在此处输入图像描述

And a relationship created between the two tables 'Employee' to 'Employee Type'

在此处输入图像描述

You use the lookup table as the axis, you can then select on the Axis settings 'Show items with no data'

在此处输入图像描述

In the above images, both have the Axis 'Employee Type' coming from the linked table. The one on the left does not have the 'Show items with no data' option selected, the one on the right does.

If you want you can add a numerical column to the 'Employee Type' table to use 'Sort by other column' to order them in a defined order, rather than alphabetical.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM