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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

Reply
derekli17001
Frequent Visitor

How to make Timeline text turn yellow once a data is reached?

Hello - i am using the Timeline by Queryon Visual and have this table as my data:

CustomerDateDescription
A14/12/2026Contract end
B31/08/2026Contract end
C30/11/2026Contract end


Is it possible to make the Description text turn to red/orange colour once we enter within the 1 year range of the "Date"?

1 ACCEPTED SOLUTION
v-jtian-msft
Community Support
Community Support

Hi,@derekli17001 ,I am glad to help.
According to your description, you want to change the Description of the records within the last one year to another colour in order to highlight them?
If I understand you correctly, then you can refer to my solution.

Here is the test data I created.

vjtianmsft_0-1714373569127.png

 


I created a calculated column to show the number of days difference between each row of data and the current point in time
If this value is less than or equal to 365 days, then the record needs to be color coded.
I then created a measure that does the same thing, (the calculated column I just created to explain the basic idea)
If the difference is less than or equal to one year, it is marked as "yellow", otherwise it is not marked with a color

vjtianmsft_1-1714373634487.png

Here is the DAX code:

M_ =
VAR tableDate =
MIN ( 'YourTable'[t_Date] )
VAR nowData =
TODAY ()
VAR differ =
DATEDIFF ( nowData, tableDate, DAY )
RETURN
IF ( differ <= 365, "yellow", IF ( differ > 365, "" ) )

Use table to display the data, and then according to Visualizations in the Cell elements to dynamically set the style, here I set the background.

vjtianmsft_2-1714373732492.png
Choose to change the style of "Description".

vjtianmsft_3-1714373786930.png

Here the choice is to change the color according to the value of M_ (just set to show yellow if the number of days is less than or equal to 365)

vjtianmsft_4-1714373802208.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.




 






View solution in original post

1 REPLY 1
v-jtian-msft
Community Support
Community Support

Hi,@derekli17001 ,I am glad to help.
According to your description, you want to change the Description of the records within the last one year to another colour in order to highlight them?
If I understand you correctly, then you can refer to my solution.

Here is the test data I created.

vjtianmsft_0-1714373569127.png

 


I created a calculated column to show the number of days difference between each row of data and the current point in time
If this value is less than or equal to 365 days, then the record needs to be color coded.
I then created a measure that does the same thing, (the calculated column I just created to explain the basic idea)
If the difference is less than or equal to one year, it is marked as "yellow", otherwise it is not marked with a color

vjtianmsft_1-1714373634487.png

Here is the DAX code:

M_ =
VAR tableDate =
MIN ( 'YourTable'[t_Date] )
VAR nowData =
TODAY ()
VAR differ =
DATEDIFF ( nowData, tableDate, DAY )
RETURN
IF ( differ <= 365, "yellow", IF ( differ > 365, "" ) )

Use table to display the data, and then according to Visualizations in the Cell elements to dynamically set the style, here I set the background.

vjtianmsft_2-1714373732492.png
Choose to change the style of "Description".

vjtianmsft_3-1714373786930.png

Here the choice is to change the color according to the value of M_ (just set to show yellow if the number of days is less than or equal to 365)

vjtianmsft_4-1714373802208.png

I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.

Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.




 






Helpful resources

Announcements
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.