March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
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!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
124 | |
82 | |
69 | |
53 | |
44 |
User | Count |
---|---|
202 | |
106 | |
100 | |
64 | |
56 |