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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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

 

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.










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


Proud to be a Super User!









"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?










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


Proud to be a Super User!









"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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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