Forum Discussion
Line chart - want to NOT CONNECT data series, using legend
Hi Alexandreau -create a calculated column that assigns a label to each row based on whether the date falls on a weekday, Saturday, or Sunday.
DayType =
SWITCH(
WEEKDAY([Date], 2),
6, "Saturday",
7, "Sunday",
"Weekday"
)
you can add Conditional Formatting for the Line Chart
Power BI supports conditional formatting for line colors. You can configure the line color to vary based on the "DayType" column.
In the Line chart visual, select the Line color option in the Format pane.
Set a rule-based conditional format:
Assign one color for "Weekday."
Assign another color for "Saturday."
Assign a third color for "Sunday."
This ensures that the line stays continuous and colors shift as desired.
If Power BI still causes issues with disconnected lines:
Add Null Values for Missing Data Points:
Ensure there are null values (or zeros) for all days where the "Cena" value does not exist, forcing Power BI to stop connecting the line between separate series.
I cannot see the option conditional formatting - it should be in this place:
My chart is a line chart, with only 1 data series.
BTW , i tried also use an etiquette , but it didn't work correctly - the etiquette was showing only 1 value (czwartek - in Polish thuesday) for each day. It looked like there is no neccessary relation. But in fact, the relation is, and works, what I can prove when I use the same data, and another visualsation - then the week day works correctly.
The reason is, I cannot set "Don't sum" , and it automatically takes some kind of calculation (in this case - Pierwszy - Polish - First)
While I change line chart into a table, there is possibility to change the setting "Don't Sum", and then it works ok.
Finally, I would love if there is a possibility to use different colours, not the etiquets - colours are more straightforward for the report'users.