Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
esuryahadi
Helper I
Helper I

Need Help DAX with Case

Hello,

I have a table like this.

IDIndexStart DateFinish DateDaysStatusAlert
1AW201/09/202316/11/202376On Going 
2AD302/08/202316/10/202375On Going 
3AF503/08/202317/11/2023106On Going 
4AH304/08/202311/10/202368On Going 
5DD105/08/202305/09/202331Finish 


I want to create an alert column with the condition that if the completion date column is less than 30 days from the current date then the alert column is yellow.
If the completion date column is later than today's date then the alert column is red.
However, if the status column is complete then the alert column is black

I ask for input on this matter

 

Thank you

ES

 

1 ACCEPTED SOLUTION

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.

 

Jihwan_Kim_0-1697464564170.png

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

View solution in original post

4 REPLIES 4
esuryahadi
Helper I
Helper I

thank you so much

Jihwan_Kim
Super User
Super User

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.

Jihwan_Kim_0-1697429822288.png

Jihwan_Kim_1-1697429844124.png

 

Jihwan_Kim_2-1697429864377.png

 

Jihwan_Kim_3-1697429878519.png

 

 

 

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

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

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.

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.

 

Jihwan_Kim_0-1697464564170.png

 


If this post helps, then please consider accepting it as the solution to help other members find it faster, and give a big thumbs up.


Click here to visit my LinkedIn page

Click here to schedule a short Teams meeting to discuss your question.

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.