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 moreJoin the FabCon + SQLCon recap series. Up next: Power BI, Real-Time Intelligence, IQ and AI, and Data Factory take center stage. All sessions are available on-demand after the live show. Register now
Hi all,
I have what I feel should be a simle solution but cant work it out.
I have a column chart to display number of orders per weekday; I have calculated the Max & Min of the weekdays.
My problem is setting the column colours to match the result, i.e. if Thursday has the MIN value colour Red else Blue.
Tried the standard switch function wihtout luck 🙁.
Thanks in anticipation.
Solved! Go to Solution.
Hi @NGC48,
You can add a calculated column to your fact table to stored weekday and write a measure formula to use on condition color formation.
Calculate column
WeekdayName = FORMAT([Date],"ddd")
Measure:
color formatting =
VAR varTable =
SUMMARIZE (
ALLSELECTED ( 'fact' ),
[WeekdayName],
"Count", COUNTROWS ( 'fact' )
)
VAR _min =
MINX ( varTable, [Count] )
VAR _max =
MAXX ( varTable, [Count] )
VAR _curr =
CALCULATE ( COUNTROWS ( 'fact' ), VALUES ( 'fact'[WeekdayName] ) )
RETURN
IF ( _curr = _min, "Red", IF ( _curr = _max, "Green", "Blue" ) )
Regards,
Xiaoxin Sheng
Try
Color Category = SWITCH(true(),
Max(Sheet1[Weekday]) in weekday(Today()) && [value]=[Max weekly value],"Red",
"Blue"
)
Can you share sample data and sample output.
Thank You Amitchandak.
I Have created an example using Northwind data;
Hi @NGC48,
You can add a calculated column to your fact table to stored weekday and write a measure formula to use on condition color formation.
Calculate column
WeekdayName = FORMAT([Date],"ddd")
Measure:
color formatting =
VAR varTable =
SUMMARIZE (
ALLSELECTED ( 'fact' ),
[WeekdayName],
"Count", COUNTROWS ( 'fact' )
)
VAR _min =
MINX ( varTable, [Count] )
VAR _max =
MAXX ( varTable, [Count] )
VAR _curr =
CALCULATE ( COUNTROWS ( 'fact' ), VALUES ( 'fact'[WeekdayName] ) )
RETURN
IF ( _curr = _min, "Red", IF ( _curr = _max, "Green", "Blue" ) )
Regards,
Xiaoxin Sheng
Hi Xiaoxin Sheng, how wuld this work if I applied a date hierarchy; for example week number down to weekday?
if I ahve a day that matches the min I see that may work but not the max? for example the max for all Fridays could be 265, not single Friday will have the same value.
Regards, Noel
Thank You Xiaoxin Sheng 😊 is this the only way you would consider achiveing this? could the formtting be seperated from the calculation and still work as a sperate measure?
Regards, Noel
Check out the April 2026 Power BI update to learn about new features.
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.
| User | Count |
|---|---|
| 48 | |
| 40 | |
| 37 | |
| 20 | |
| 16 |
| User | Count |
|---|---|
| 68 | |
| 67 | |
| 30 | |
| 26 | |
| 26 |