I have a column in a CSV-file with about 60 e-mail addresses of which maybe 45 are valid addresses, five have the value NULL and the rest are empty rows. I want to display the column as a pie chart in the following way: one slice for the valid addresses, one slice for the NULL ones and another slice for the empty rows. Is this possible and if so, how would I go about doing it? Or do I always need two columns for a pie chart? Sorry if this is a bad question, I'm new to Power BI.
1 Answers
For Pie Charts, you need a column for "Legend" (if you want multiple slices on your pie chart) and either a column or a measure for "Values".
You don't always need 2 columns for a pie chart, but in your case, you can't accomplish what you want to accomplish without creating an additional column.
Your additional column needs to be derived from email address and should categorize each row into Valid, NULL, or Empty Row. There's no way around this since this is how you want to divide your pie chart up.
Once you've created this additional column, place it under "Legend" on the Pie Chart visual.
Now for "Values", you have some flexibility:
- You can use the same derived column you used on Legend.
- You can use the raw email address column.
- You can create a measure for Email Address count and use that instead.
For #1 and #2, Power BI will recognize that you've used a text column as your value, and will convert it to a row count for you.
None of these eliminate the need for creating the additional column for your Legend. But #1 and #3 both do mean you're only using one column on your pie chart. With #1 you're using the same column in 2 places. With #3 you're using a column and a measure.
Hope this helps.