Forum Discussion

Anonymous's avatar
Anonymous
Not applicable
6 years ago

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

  • 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's avatar
      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?