Power BI is turning 10! Tune in for a special live episode on July 24 with behind-the-scenes stories, product evolution highlights, and a sneak peek at what’s in store for the future.
Save the dateEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Dears,
I hope you all are doing well,
i want to write DAX to make conditional formatting for the "fuel last date" column in this visual table.
to display in red color if they exceed the number in the "Max per day" column and green if they do not exceed.
please note that: Fuel last Date is a measure and Max per day is a calculated column.
Thanks
Solved! Go to Solution.
hi @some_bih ,
try to apply conditional formating with a measure like:
Fuel last Date color=
IF(
CALCULATE(
[Fuel Total Quantity],
FILTER(
'F Dim Date',
'F Dim Date'[Date] = MAX('F Dim Date'[Date])
)
) > MAX(data[Max per day]),
"red", "green"
)
more about conditional formatting:
https://learn.microsoft.com/en-us/power-bi/create-reports/desktop-conditional-table-formatting
Dear @FreemanZ
Thanks for reply
I tried to use it, but I can't select it. How can I resolve this, or what could be the issue?
Kindly see the snapshot
Thanks,
Dear @FreemanZ
It Works.
The problem was that the column "max capacity per day " from the original table was formatted as text, not a number, preventing the code from working.
I would like to thank you too much for your time and effort, have a nice day
Hi @mhablas426 try measure definition below (save your work before)
Fuel last Date =
VAR __max_date=MAX('F Dim Date'[Date])
RETURN
CALCULATE(
[Fuel Total Quantity],
FILTER('F Dim Date','F Dim Date'[Date] = __max_date))
Proud to be a Super User!
Hi @some_bih
I've been using your DAX formula instead of mine. Would you mind explaining the differences between the two.
but my main concern is about applying conditional formatting for this visual table could you please advise
Hi @mhablas426 at moment when I saw your measure I understand that you want to filter max date so I rewrite your measure.
Proud to be a Super User!
Check out the July 2025 Power BI update to learn about new features.
This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.
User | Count |
---|---|
70 | |
68 | |
43 | |
34 | |
26 |
User | Count |
---|---|
86 | |
49 | |
45 | |
38 | |
37 |