Check your eligibility for this 50% exam voucher offer and join us for free live learning sessions to get prepared for Exam DP-700.
Get StartedDon't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.
I have a table visual with a a Date/Time Column which has some null values. I've effectively applied conditional formatting to that visual by utilising a switch measure. The problem is I'm getting "empty" cells formatted to green. I'd like them to be ignored and left without formatting, but the changes I do to the measure don't seem to work.
DateStatus =
VAR TodayDate = TODAY()
VAR ApptDate = MAX('factPropertiesRemAppts'[dtmAppt])
RETURN
SWITCH(
TRUE(),
ISBLANK(ApptDate), "White", -- This is the line i added, but it didn't change anything
ApptDate > TodayDate, "Green",
ApptDate = TodayDate, "Yellow",
ApptDate < TodayDate, "Red"
)
DateStatus =
VAR TodayDate = TODAY()
VAR ApptDate = MAX('factPropertiesRemAppts'[dtmAppt])
RETURN
IF(
ISBLANK(ApptDate),
BLANK(), -- I added this and the If statement, but also no effect.
SWITCH(
TRUE(),
ApptDate > TodayDate, "Green",
ApptDate = TodayDate, "Yellow",
ApptDate < TodayDate, "Red"
)
)
Can you help?
Solved! Go to Solution.
I have solved it. It's very emberrassing. The problem was I was refferring to a different column in the measure than I wanted to apply the conditional formatting to. Bothe measures in the question will work just fine as long as we change the column name. The correct Measure looks like this:
DateStatus =
VAR TodayDate = TODAY()
VAR ApptDate = MAX('factPropertiesRemAppts'[RemJobdtmAppt])
RETURN
SWITCH(
TRUE(),
ISBLANK(ApptDate), BLANK(), -- Leave blank if there is no date
ApptDate > TodayDate, "Green",
ApptDate = TodayDate, "Yellow",
ApptDate < TodayDate, "Red"
)
I have solved it. It's very emberrassing. The problem was I was refferring to a different column in the measure than I wanted to apply the conditional formatting to. Bothe measures in the question will work just fine as long as we change the column name. The correct Measure looks like this:
DateStatus =
VAR TodayDate = TODAY()
VAR ApptDate = MAX('factPropertiesRemAppts'[RemJobdtmAppt])
RETURN
SWITCH(
TRUE(),
ISBLANK(ApptDate), BLANK(), -- Leave blank if there is no date
ApptDate > TodayDate, "Green",
ApptDate = TodayDate, "Yellow",
ApptDate < TodayDate, "Red"
)
I did, but with not effect
Is it possible for you to share the .pbix file removing any sensible information?
Proud to be a Super User!
When i drag and drop it tells me the file type (.pbix) is not supported. Any other way I can upload a file here?
Try sending me a DM and there I can provide you an e-mail 🙂
Proud to be a Super User!
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Prices go up Feb. 11th.
Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.
User | Count |
---|---|
146 | |
87 | |
66 | |
52 | |
46 |
User | Count |
---|---|
215 | |
90 | |
83 | |
66 | |
58 |