Don't miss your chance to take the Fabric Data Engineer (DP-600) exam for FREE! Find out how by attending the DP-600 session on April 23rd (pacific time), live or on-demand.
Learn moreNext up in the FabCon + SQLCon recap series: The roadmap for Microsoft SQL and Maximizing Developer experiences in Fabric. All sessions are available on-demand after the live show. Register now
Hi,
As in atthached figure, am trying to highligh the day -7 and day -14 with a differemt color in x-axis (date), in the column or in label. Although the code is working well, it is not changing the color of the specific dates for date, column or label.
I share also the code used:
ReferencePoints =
VAR _teste1 = DATEDIFF(CALCULATE(MAX('1.0_DateFilter'[Date]), ALL('1.0_DateFilter'[Date])), MAX('1.0_DateFilter'[Date]), DAY)
RETURN
SWITCH(TRUE(), _teste1 = -7, 1,
_teste1 = -14, 2,
0)
How to solve? Any other solution for this situation?
Thanks.
SQ
Solved! Go to Solution.
Thanks for Kedar_Pande and lbendlin's concern about this issue.
Hi, @sergioquerido
I am glad to help you.
In Power BI, we can set all X-axis values to be uniformly a certain color:
But unfortunately, it is not possible to individually display the value of an X-axis as a certain color by creating a conditional format, which is not directly supported by Power BI Desktop itself.
If you really want to display the X-axis values in a certain color, perhaps you can use it in conjunction with Table visual, something like this:
I have attached the pbix file for this small example below, I hope it helps.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Thanks for Kedar_Pande and lbendlin's concern about this issue.
Hi, @sergioquerido
I am glad to help you.
In Power BI, we can set all X-axis values to be uniformly a certain color:
But unfortunately, it is not possible to individually display the value of an X-axis as a certain color by creating a conditional format, which is not directly supported by Power BI Desktop itself.
If you really want to display the X-axis values in a certain color, perhaps you can use it in conjunction with Table visual, something like this:
I have attached the pbix file for this small example below, I hope it helps.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Fen Ling,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Best you can do with standard visuals is change the color of the bar. For anything else you would need custom visuals.
Create a Measure to Identify Special Days:
Apply Conditional Formatting:
This approach should allow you to highlight those specific days with a different color.
Thanks @Kedar_Pande ,
The following code works with the conditional formatting for collumns and labels but not for dates in x-axis.
10.0_ReferencePoints =
SWITCH(TRUE(),
SELECTEDVALUE('1.0_DateFilter'[Date]) = LASTDATE(ALL('1.0_DateFilter'[Date]))-7, 1,
SELECTEDVALUE('1.0_DateFilter'[Date]) = LASTDATE(ALL('1.0_DateFilter'[Date]))-14, 2,
0)If you have recently started exploring Fabric, we'd love to hear how it's going. Your feedback can help with product improvements.
A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.
Share feedback directly with Fabric product managers, participate in targeted research studies and influence the Fabric roadmap.
| User | Count |
|---|---|
| 48 | |
| 43 | |
| 39 | |
| 19 | |
| 17 |
| User | Count |
|---|---|
| 69 | |
| 63 | |
| 32 | |
| 30 | |
| 23 |