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

The ultimate Microsoft Fabric, Power BI, Azure AI & SQL learning event! Join us in Las Vegas from March 26-28, 2024. Use code MSCUST for a $100 discount. Register Now

Reply
Anonymous
Not applicable

Conditional Formatting Data Labels

HI All,

I have a line graph which has some values shown as data labels, i would like to conditionally format these labels. Can anyone help?

Labels.png

 

 

1 ACCEPTED SOLUTION
MFelix
Super User
Super User

Hi  @Anonymous ,

 

You cannot condittional formatting data labels however you can make a work around:

 

Create 3 measures:

Total Values = SUM(Table[Column])

Total Values Above =  IF([Total Values] < 100; BLANK(); [Total Values] )

Total Values Below=  IF([Total Values] < 100; [Total Values] ;BLANK())
​

Now add your measure to the line chart and make the following setup:

Turn of the lines on the Values above and below

Turn off data labels on the Total Values measure

Make different formatting for labels for lines above and below

 

Adjust the measure to what you need if you want to have additional levels you need to create additional measures.

 

Check PBIX file attach.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



View solution in original post

3 REPLIES 3
mdutot
Frequent Visitor

I sympathize with this issue. Here's an example. Data labels for certain values can show up as 0.0K, but having all data labels in raw units just looks crowded (ie. 4.2K > 4,200 and 144 > 0.1K). There should be conditional formatting for units as there is for color. 

mdutot_0-1659562664636.png

 

I submitted an idea ticket: https://ideas.powerbi.com/ideas/idea/?ideaid=10ba158d-4e13-ed11-b5cf-281878bd0909

 

v-jayw-msft
Community Support
Community Support

Hi @Anonymous ,

 

Have your problem be solved? Please consider accept the answer as a solution if it worked.

 

Best Regards,

Jay

Community Support Team _ Jay Wang

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Community Support Team _ Jay
If this post helps, then please consider Accept it as the solution
to help the other members find it.
MFelix
Super User
Super User

Hi  @Anonymous ,

 

You cannot condittional formatting data labels however you can make a work around:

 

Create 3 measures:

Total Values = SUM(Table[Column])

Total Values Above =  IF([Total Values] < 100; BLANK(); [Total Values] )

Total Values Below=  IF([Total Values] < 100; [Total Values] ;BLANK())
​

Now add your measure to the line chart and make the following setup:

Turn of the lines on the Values above and below

Turn off data labels on the Total Values measure

Make different formatting for labels for lines above and below

 

Adjust the measure to what you need if you want to have additional levels you need to create additional measures.

 

Check PBIX file attach.


Regards

Miguel Félix


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

Proud to be a Super User!

Check out my blog: Power BI em Português



Helpful resources

Announcements
Fabric Community Conference

Microsoft Fabric Community Conference

Join us at our first-ever Microsoft Fabric Community Conference, March 26-28, 2024 in Las Vegas with 100+ sessions by community experts and Microsoft engineering.

February 2024 Update Carousel

Power BI Monthly Update - February 2024

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

Fabric Career Hub

Microsoft Fabric Career Hub

Explore career paths and learn resources in Fabric.

Fabric Partner Community

Microsoft Fabric Partner Community

Engage with the Fabric engineering team, hear of product updates, business opportunities, and resources in the Fabric Partner Community.

Top Solution Authors