cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Anonymous
Not applicable

Calender Default date today's date and forward 6months

Hi,

I have start date which is having dates from 2016 to 2020 so user wants start date dy default is today( Nov17,2020)it's calender approach and end date is by default 6 months i.e (Apr17,2020). How to achieve this?

 

What i did was have taken disconnected date table and used below code and joined to main table (Start date=Date) but iam not sure how to get by default today's date in start date and 6 months in end date. User shoould be able to select freely like how we are selecting in calender. Kindly suggest.

Calendar =
var _cal = CALENDAR(Min(Start Date]),Max(Start Date]))
RETURN
ADDCOLUMNS (
_cal,
"Year", YEAR([Date]),
"MonthNumber", MONTH([Date]),
"Month",FORMAT([Date],"mmm"),
"Month Year",FORMAT([Date],"mmm yyyy"),
"Month Year Number",FORMAT([Date],"yyyy mm"),
"MonYear",FORMAT([Date],"mmyyyy")
)
 
Regards,
Venkat
 
1 ACCEPTED SOLUTION
Super User IV
Super User IV

@Anonymous , As of now you have to create a flag like this and set yes as default value

Default Date = if([Date] >= today() && [Date] <=date(year(today() ),month(today() ), day(today() )), "Yes", "No")



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

 

@mahoneypat 

Hi, So with your calculation i have used it in slider and showing as expected. Let me explain to client if he satisfies i will come back. Thank you. Please let me know if any changes.

 

 @amitchandak 

Thanks for your time and sugestion. I will come back

 

 

 

Thanks,

Venkat

Super User IV
Super User IV

@Anonymous , As of now you have to create a flag like this and set yes as default value

Default Date = if([Date] >= today() && [Date] <=date(year(today() ),month(today() ), day(today() )), "Yes", "No")



Did I answer your question? Mark my post as a solution! Appreciate your Kudos!!
Dashboard of My Blogs !! YouTube Channel !! Connect on Linkedin

Proud to be a Super User!

View solution in original post

Super User IV
Super User IV

You can replace your variable with this expression to get that.

 

var _cal = CALENDAR(TODAY(),EDATE(TODAY(), 6))

 

Regards,

Pat





Did I answer your question? Mark my post as a solution! Kudos are also appreciated!

To learn more about Power BI, follow me on Twitter or subscribe on YouTube.


@mahoneypa HoosierBI on YouTube


Helpful resources

Announcements
secondImage

Congratulations!

We are excited to announce the Power BI Super Users!

Wave Release 2

Check out the updates in Power BI.

Overview of Power BI 2020 release wave 2!

Microsoft Ignite

Microsoft Ignite

Join digitally, March 2–4, 2021 to explore new tech that's ready to implement. Experience the keynote in mixed reality through AltspaceVR!

secondImage

The largest Power BI virtual conference

100+ sessions, 100+ speakers, Product managers, MVPs, and experts. All about Power BI. Attend online or watch the recordings.

Top Solution Authors
Top Kudoed Authors