Forum Discussion
Show a Text based on a Date
- 4 years ago
Hi, giovanni_figuei
Please check the following methods.
Measure = VAR N1 = SWITCH ( TRUE (), SELECTEDVALUE ( 'Table'[Date] ) >= DATE ( 2020, 4, 15 ) && SELECTEDVALUE ( 'Table'[Date] ) <= DATE ( 2022, 12, 31 ), "VALID", SELECTEDVALUE ( 'Table'[Date] ) < DATE ( 2020, 4, 15 ), "INVALID", SELECTEDVALUE ( 'Table'[Date] ) > DATE ( 2022, 12, 31 ), "INVALID" ) RETURN N1If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?
Best Regards,
Charlotte Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
The information you have provided is not making the problem clear to me. Can you please explain with an example.
Can you share sample data and sample output in table format? Or a sample pbix after removing sensitive data.
Appreciate your Kudos.
- giovanni_figuei4 years agoFrequent Visitor
Hi thanks for the reply. This dates wich this codes are usable are classified for the users it is just me that have access to, them said that, i only want to show if the code is valid in the date of today not show the dates themselves. Like this: if the end date is tomorrow for exemple the code will be valid but if it is yesterday it will be invalid.
I want this to happen but this "VALID" text be responsive in the conditions i mentioned above - giovanni_figuei4 years agoFrequent Visitor
I was thinking something with this logic :
IF (date of today)>(end date)
then (display "INVALID")
IF (Date of today)<(end date)
then (display "Valid")- v-zhangti4 years agoCommunity Support
Hi, giovanni_figuei
Please check the following methods.
Measure = VAR N1 = SWITCH ( TRUE (), SELECTEDVALUE ( 'Table'[Date] ) >= DATE ( 2020, 4, 15 ) && SELECTEDVALUE ( 'Table'[Date] ) <= DATE ( 2022, 12, 31 ), "VALID", SELECTEDVALUE ( 'Table'[Date] ) < DATE ( 2020, 4, 15 ), "INVALID", SELECTEDVALUE ( 'Table'[Date] ) > DATE ( 2022, 12, 31 ), "INVALID" ) RETURN N1If the method I provided above can't solve your problem, what's your expected result? Could you please provide more details for it?
Best Regards,
Charlotte Zhang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- giovanni_figuei4 years agoFrequent Visitor
Thank you so much helped me a lot S2