Forum Discussion
Conditional Formatting on a Attribute/Value table
- Anonymous2 years ago
Hi peterg0417
Thanks for your explaination, please try this:
First of all, I add a measure:
Measure = VAR _DateofAttribute = SELECTEDVALUE('Table'[Attribute]) = "Effective Date" || SELECTEDVALUE('Table'[Attribute]) = "Expiration Date" VAR _DateDiff = IF( _DateofAttribute, ABS(DATEDIFF( DATEVALUE(SELECTEDVALUE('Table'[Formatted Value])), TODAY(), DAY )) ) RETURN IF( _DateDiff <> BLANK() && _DateDiff < 90, "Red" )Then click the [Formatted Value] field and choose the Conditional formatting > Font color
Choose Field value and select the measure in the what field should we base this on? multi-check box.
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
| Attribute | Formatted Value |
| Overall Project Duration (Months) | 10 Months |
| Below Grade Construction | |
| Above Grade Construction | |
| Time to Substantial Performance | 0 Months |
| Effective Date | 2022-10-31 |
| Expiration Date | 2024-05-01 |
| Owner (OCIP/CCIP) | Test |
| # of Floors | 3 |
| # of Parking Spaces | 9 |
| # of Suites | '- |
| Procurement Status | 100% |
| Above Grade (SF) | 10,339 |
| Below Grade (SF) | '- |
| Total (SF) | 10,339 |
| Asset Class | Mixed-Use |
Please see "Expiration Date". The date is highlighted in red because it is within 90 days. I want to apply this conditional format within the existing DAX measure, "Formatted Value" that I provided above. For Expiration Date and Effective Date.
The issue is that The values are all text, unless it's a number. If it's a number then I apply a custom format string to it, from the variable "_Formatting"
Hi peterg0417
Thanks for your explaination, please try this:
First of all, I add a measure:
Measure =
VAR _DateofAttribute = SELECTEDVALUE('Table'[Attribute]) = "Effective Date" || SELECTEDVALUE('Table'[Attribute]) = "Expiration Date"
VAR _DateDiff = IF(
_DateofAttribute,
ABS(DATEDIFF(
DATEVALUE(SELECTEDVALUE('Table'[Formatted Value])),
TODAY(),
DAY
))
)
RETURN
IF(
_DateDiff <> BLANK() && _DateDiff < 90,
"Red"
)
Then click the [Formatted Value] field and choose the Conditional formatting > Font color
Choose Field value and select the measure in the what field should we base this on? multi-check box.
The result is as follow:
Best Regards
Zhengdong Xu
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.