Forum Discussion
Need Help DAX with Case
- 2 years ago
Hi,
I think my understanding of the logic was wrong.
I tried to fix it and please check the below picture and the attached pbix file if it suits your requirement.
Hi,
I am not sure if I understood your question correctly about the red yellow color condition, but please check the below picture and the attached pbix file.
One of many ways to achieve this is,
- create a measure [Alert:]
- configure conditional background color
- configure conditional font color that exactly the same as the background color in order not to show the result of the [Alert:] measure.
Alert : =
IF ( HASONEVALUE ( Data[ID] ), "Alert" )
Alert rules measure: =
VAR _today =
TODAY ()
VAR _result =
SWITCH (
TRUE (),
SELECTEDVALUE ( Data[Finish Date] ) > _today, "Red",
SELECTEDVALUE ( Data[Finish Date] ) > _today - 30, "Yellow"
)
RETURN
_result
Alert rules font color: =
VAR _today =
TODAY ()
VAR _result =
SWITCH (
TRUE (),
SELECTEDVALUE ( Data[Finish Date] ) > _today, "Red",
SELECTEDVALUE ( Data[Finish Date] ) > _today - 30, "Yellow",
"White"
)
RETURN
_result
- esuryahadi2 years ago
Helper I
Thank you in advance and I apologize for any inconvenience. However, there are some discrepancies that need to be addressed. Specifically, ID 2 should be marked in red as it has exceeded the completion date. On the other hand, ID 3 should not remain in white, since its completion date is still far away.
- Jihwan_Kim2 years ago
Super User
Hi,
I think my understanding of the logic was wrong.
I tried to fix it and please check the below picture and the attached pbix file if it suits your requirement.