The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Hi all,
I am trying to conditional format the color of my x-axis labels and data labels. My target is only show an axis label and data label for the min and max selected date (there is a date slicer)
I thought about creating a measure that will color the min and max date to black and all other selected dates to white
My date table has a column for the date (date format) which is filtered by the user, and a column for the month-year combination (text format)
I use the month-year column in my x-axis label and some measure for the y-axis
the measure I wrote is:
I don't use my date column in the graph because the measure doesn't work with date hierarchy and because I want to show a short month-year format in a uinque way
Help will be appreciated
@MichaelStrauss , Try a measure like
Measure =
var _max = maxx(allselected(Date),Date[Date])
var _min = minx(allselected(Date),Date[Date])
return
if(Max(Date[Date]) = _max || Min(Date[Date]) =_min, "#000000","#FFFFFF")
Hi @amitchandak
Thank you for your answer. Unfortunately the measure does not work, all labels returned black (#000000)
User | Count |
---|---|
85 | |
84 | |
36 | |
34 | |
30 |
User | Count |
---|---|
92 | |
79 | |
66 | |
55 | |
52 |