Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!Calling all Data Engineers! Fabric Data Engineer (Exam DP-700) live sessions are back! Starting October 16th. Sign up.
Hello All. I'm new to Power BI.
I have built a scatter plot distribution chart. I have a numerical value on the x-axis and a jitter on the y-axis. I can't figure out (if it's possible) how to color only the dots of a certain day/month/year/etc. For example, how would I color all the dots red for April 2021?
My timestamp is in the details field (made up of a bunch of discrete dates/times).
Any suggestions on how to do this? Or maybe suggestions on a different way to build the chart?
Thanks in advance.
Solved! Go to Solution.
Hi @Anonymous
Please try measure as:
Measure =
IF(
MONTH(MAX('Table'[Date]))=1,
"red",
"blue"
)
You can also use 'Year(MAX('Table'[Date]))=2021' or 'MAX('Table'[Date])="2021,08,01"'.
If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
Hi @Anonymous
Please try measure as:
Measure =
IF(
MONTH(MAX('Table'[Date]))=1,
"red",
"blue"
)
You can also use 'Year(MAX('Table'[Date]))=2021' or 'MAX('Table'[Date])="2021,08,01"'.
If you still have some question, please don't hesitate to let me known.
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
@v-xulin-mstf thanks for this solution. Is there a way to color every month or quarter and have a legend or is this code only good for coloring a single month/quarter?
Hi @Anonymous
If you need to set different colors for multiple date ranges, you can use switch function.
Just like:
= SWITCH([Month], 1, "red", 2, "green", 3, "yellow", 4, "blue", else)
Best Regards,
Link
Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution. Really appreciate!
@Anonymous , You can create a color measure and use that
I have one example here, see if that can help
@amitchandak thanks for the answer.
Like i said above, I'm very new to Power BI and I'm having a difficult time taking the DAX code for your measure and converting it to what I need it to do. How would I make a DAX code that will highlight red the dots for April 2021? I'm struggling with what DAX commands to use for date...would I just use MONTH and YEAR?
Also, once I create a measure, what do I do with it to make it take effect...drag it to one of the details fields?
Join the Fabric FabCon Global Hackathon—running virtually through Nov 3. Open to all skill levels. $10,000 in prizes!
Check out the October 2025 Power BI update to learn about new features.