Forum Discussion
Measure If Date Less than Another Date
- 7 years ago
No dice on the change. But I did find a workaround. Ii added a custom column in the query to list all dates between the start and end date.
{ Number.From([startdate])..Number.From([enddate])}
then expanded the list and converted to date format. Used a value in the dataset to populate the cells in the visual and then conditionally formatted.
I would still love to know if there is an answer to the original question...this is the long way around.
Hi AMPAllie ,
You can create new calendar table Calendar and new column StartofWeek, and then create measure Colors. Rename the table and filed to take it effective.
Calendar = CALENDARAUTO()
StartofWeek = WEEKDAY('Calendar '[Date],2)
Colors =
var d=CALCULATE(SELECTEDVALUE('Calendar'[Date]),FILTER(Calendar,'Calendar '[StartofWeek]="1"))
var v=SELECTEDVALUE(Table1[Project])
return IF(Table1[Project]=v&&d<=Table1[EndDate]&&d>=Table1[StartDate],"Y","N")
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
So I had to change it up a bit and here's what Im using
- AMPAllie7 years agoHelper II
Ok, I got it to put the "Y" on the visual. However, it's only putting one for the start date...not the span:
- v-xicai7 years agoCommunity Support
Hi AMPAllie ,
Try to change it to "'Calendar'[StartofWeek]=1" in the the measure Colors, and try it again, based on the column Key(2) working fine. Or you can share your more detail sample data or screenshots for further analysis. Do mask sensitive data before uploading.
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
- AMPAllie7 years agoHelper II
No dice on the change. But I did find a workaround. Ii added a custom column in the query to list all dates between the start and end date.
{ Number.From([startdate])..Number.From([enddate])}
then expanded the list and converted to date format. Used a value in the dataset to populate the cells in the visual and then conditionally formatted.
I would still love to know if there is an answer to the original question...this is the long way around.