Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hello - i am using the Timeline by Queryon Visual and have this table as my data:
Customer | Date | Description |
A | 14/12/2026 | Contract end |
B | 31/08/2026 | Contract end |
C | 30/11/2026 | Contract 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"?
Solved! Go to Solution.
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.
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
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.
Choose to change the style of "Description".
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)
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.
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.
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
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.
Choose to change the style of "Description".
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)
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.
User | Count |
---|---|
98 | |
90 | |
78 | |
71 | |
64 |
User | Count |
---|---|
114 | |
97 | |
95 | |
68 | |
65 |