Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

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
amitchandak
Super User
Super User

@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")

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

amitchandak
Super User
Super User

@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")

mahoneypat
Employee
Employee

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
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.