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

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now! Learn more

Reply
MeiYing
Helper I
Helper I

Pie chart in power bi

Hi, 

 

I am trying to display number of orders in pie chart by different categories (which I use legends). The pie chart is able to display number of orders in slices with the value label on each slice. But, when there is only one category, the value is not displayed in center (just like the image below). I cannot find any setting to make the alignment in center. I saw one online post saying that we can use transparent card to display the data in this case, but it works only when there is one category. Has anyone encountered this issue before?  Thank you all in advance!

MeiYing_0-1715053624987.png

 

1 ACCEPTED SOLUTION

Hi @MeiYing ,

You can make a card not to display anything when there isn't a single category in the current filter context

card  measure =
IF ( SELECTEDVALUE ( data[category], "" ) = "", [measure] )

The second argument in SELECTEDVALUE returns a specific value when there are more than one values  available. If not specified, it will return blank() instead of something  not visible. You can use FORMAT function to format [measure] as desired.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

View solution in original post

3 REPLIES 3
MeiYing
Helper I
Helper I

Hi @danextian , thanks for the reply! Sorry, I think the way I wrote is a bit confusing. I don't want to use the card to display value for multiple categories. I want the pie chart to be like, display the value in center when there's only one category. But seems like there's no option to achieve that. 

Hi @MeiYing ,

You can make a card not to display anything when there isn't a single category in the current filter context

card  measure =
IF ( SELECTEDVALUE ( data[category], "" ) = "", [measure] )

The second argument in SELECTEDVALUE returns a specific value when there are more than one values  available. If not specified, it will return blank() instead of something  not visible. You can use FORMAT function to format [measure] as desired.





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.
danextian
Super User
Super User

Hi @MeiYing ,

 

There is no option to center-align a pie chart's data label when there's only one category.

As to the use of card, I don't get why you'd want to use it with multiple categories. How do you intend the show the label?





Dane Belarmino | Microsoft MVP | Proud to be a Super User!

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


"Tell me and I’ll forget; show me and I may remember; involve me and I’ll understand."
Need Power BI consultation, get in touch with me on LinkedIn or hire me on UpWork.
Learn with me on YouTube @DAXJutsu or follow my page on Facebook @DAXJutsuPBI.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

The Power BI Data Visualization World Championships is back! Get ahead of the game and start preparing now!

December 2025 Power BI Update Carousel

Power BI Monthly Update - December 2025

Check out the December 2025 Power BI Holiday Recap!

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.