Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
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!
Solved! Go to 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.
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.
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?
User | Count |
---|---|
77 | |
74 | |
42 | |
32 | |
28 |
User | Count |
---|---|
100 | |
93 | |
52 | |
50 | |
48 |