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
NishDash
Frequent Visitor

How to show "*" as a data label if the value is between 1 and 5 (both ends incl.) in a column chart?

Data:

Column1Column2
apple10
mango2
orange10
pineapple4
watermelon15
watermelon10

 

I have a visual as below:

NishDash_0-1676943768344.png

How to show "*" instead of 4 and 2 i.e. value is greater than 0 and less than or equal to 5?

 

If I create a new measure at below:

NishDash_1-1676943961226.png

the "*" doesn't show up. Even the bars for mango and pineapple are lost - makes sense, as "*" is not a value. 

 

However, I need to show "*" based on my criteria. I'm fine not showing any bar.


I looked around but can't figure out a way to work this out. Did anyone have a similar issue or know what to do?

7 REPLIES 7
FreemanZ
Super User
Super User

Len_Barr
Resolver I
Resolver I

Short answer, you can't.

Long answer - you shouldn't change it to *

 I'd want to know why you want to suppress a value in the first place but still leave the corresponding bar in? 

Additionally, the value count at the top of each bar is a mathematical count, it will always return a number in this bar chart. 

If the value is not important, you should just filter the visual to not show values below 4. 

Having a "*" will only add noise to your graph - if you want to show that values below a certain number are not important, I'd use colour to change the bars. Anything below 4 could be greyed out, as this subconsiously tells the reader that this part of the graph is not important. 

Alternatively, you can change the font of the value to white, that way a 4 will still be displayed, but will get drowned out in the background. 

@Len_Barr 
Reason to show a "*": I want the data to be unidentifiable. 
below is an example 

NishDash_0-1676952203001.png

in the above screenshot, there is only 1 person aged "over 90" at postcode = 1. the graph shows 5K. If the postcode =1 belongs to a small town where everyone knows each other, everyone would know that one old guy and his/her's net worth.

I am fine not showing a bar, but would definitely like to have a "*" so that viewers know data is hidden to avoid identifying personal information.

I've worked with similar problems before, where its important to suppress certain figures/ counts. 

In this case you need to create a measure and display it in a table

 

Suppressed Sum of Income = 

VAR NumberOfPeople = COUNTROWS(your table name)    //this will count the number of people//

 

RETURN

SWITCH(TRUE(), 

NumberOfPeople < 3, "*",

//this sets the number of people you want to show the maximum of per postcode//

//you can also set other conditions here, like if the total income is below a certain number, just follow (condition, result if condition met)//

SUM([Net Worth])

@Len_Barr if you look at my question, that's what I have done. I have created a measure to show "*" where the sum <= 5. 
But unfortunately, the * doesn't show up as a data label in the chart. Again, I'm fine not having a bar, but need to have "*" as a data label.

amitchandak
Super User
Super User

@NishDash , You need to use the custom label method using calculation group, if that can help

Custom label
https://www.youtube.com/watch?v=IH4bcHhxunw
Dynamic Label
https://www.esbrina-ba.com/time-intelligence-dynamic-legend-in-line-charts/

@amitchandak the link shows ways to put different measures on the same graph using a slicer. e.g. current year monthly sales and previous year monthly sales.

In my case, I not looking to have the data changed, but simply hide/mask the figure if it is 1 => x <= 5 by "*".

Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

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

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.