@Nida_Sayedi
A way to validate the dates in the datetime column datacard in PowerApps is to use the MinDate and MaxDate properties of the Date Picker control. You can set these properties based on the selected value of the choice column.
For example, if you have a choice column named Quarter and a date picker named StartDate, you can set the MinDate property of StartDate as follows:
If(
Quarter.Selected.Value = "Quater1",
Date(Year(Today()), 1, 1),
Quarter.Selected.Value = "Quater2",
Date(Year(Today()), 4, 1),
Quarter.Selected.Value = "Quater3",
Date(Year(Today()), 7, 1),
Quarter.Selected.Value = "Quater4",
Date(Year(Today()), 10, 1)
)
This will ensure that the user can only select dates from the first day of the selected quarter.
Similarly, you can set the MaxDate property of StartDate as follows:
If(
Quarter.Selected.Value = "Quater1",
Date(Year(Today()), 3, 31),
Quarter.Selected.Value = "Quater2",
Date(Year(Today()), 6, 30),
Quarter.Selected.Value = "Quater3",
Date(Year(Today()), 9, 30),
Quarter.Selected.Value = "Quater4",
Date(Year(Today()), 12, 31)
)
This will ensure that the user can only select dates until the last day of the selected quarter. You can use the same logic for the EndDate date picker as well.
If you have any questions or feedback, please let me know. Have a great day! 😊
-----------------------
PowerYsa Power Platform Enthusiast [LinkedIn] | [Youtube]
I love to share my knowledge and learn from others. If you find my posts helpful, please give them a thumbs up 👍 or mark them as a solution ✔️. You can also check out my [@PowerYSA] for some cool solutions and insights. Feel free to connect with me on any of the platforms above. Cheers! 🍻