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

Friday to Friday Dates and Lookup issues

@links to members, Content

 

All

I have a report in Power BI report builder.  I have a start date and end date.  I need to set the default start date to previous friday from day report is ran and the end date to the upcoming friday.  Example,  today is 5/31/2020 the default start date should be 5/29/2020 and the default end date should be 6/5/2020.

 

Also managers will be running this report.  I have Primary Dept parameter.  I would like for this parameter to default to the manager's department with a list of employees in that department.   I tried to use the Lookup function for this, the function works in the matrix but it will not work a default value for the Primary dept parameter.  I get an error message stating fields cannot be used in report parameters.

 

=Lookup(Fields!Name.Value, Fields!Name.Value,PrimaryDept, "DataSet2")

 

 

 

 

 

 

 

 

 

 

 

2 REPLIES 2
amitchandak
Super User
Super User

@Anonymous ,

Last Friday = 'Date'[Date]+-1*if(WEEKDAY('Date'[Date])-6<0,WEEKDAY('Date'[Date])+1,WEEKDAY('Date'[Date])-6)
Next friday  = 'Date'[Last Friday]+7

Anonymous
Not applicable

@amitchandak This  works for the default dates.  however in the range it only shows days of the week.  In the table I need to show the weekend dates as well.  Currently your formula only shows weedays in the table.  Is there a way for it to show the weekend dates in the range?

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.