Forum Discussion
Set Page title based upon Page Filter
I need to set a page title for my report based upon the page filter. This report is always going to display the last full calendar week, how would I set the page title to "Report from Sept 6, 2020 to Sept 12, 2020" based on the below filter?
Hi mvgust - sorry I didn't check my code. Try this
Pg Title = var __FromDt = FORMAT( MINX( ALLSELECTED( DateTab[Date] ), DateTab[Date] ), "MMM DD, YYYY") var __ToDt = FORMAT( MAXX( ALLSELECTED( DateTab[Date] ), DateTab[Date] ), "MMM DD, YYYY") RETURN "Report from " & __FromDt & " to " & __ToDtPage (and report filters for that matter) should be able to be accessed like any other type of filter.
Hope this helps
David
4 Replies
- dedelman_clng
Community Champion
Hi mvgust - by page "Title", do you mean the page name, or a title that appears at the top of the page?
If the former, I don't think that can be done.
If the latter, create a measure along the lines of
Pg Title = var __FromDt = FORMAT( MIN( ALLSELECTED( DateTab[Week End Date] ) ), "MMMM DD, YYYY") var __ToDt = FORMAT( MAX( ALLSELECTED( DateTab[Week End Date] ) ), "MMMM DD, YYYY") RETURN "Report from " & __FromDt & " to " & __ToDtPut that in a card visual and position it where it needs to go.
Hope this helps
David
- mvgust
Helper III
That doesn't seem to work:
"The MIN function only accepts a column reference as an argument"
Also, I'm not using a slicer, I'm using the page filter functionality. I know you can pass slicer selections but my primary issue is passing PAGE filters. I'm not finding a formula to do so?
- dedelman_clng
Community Champion
Hi mvgust - sorry I didn't check my code. Try this
Pg Title = var __FromDt = FORMAT( MINX( ALLSELECTED( DateTab[Date] ), DateTab[Date] ), "MMM DD, YYYY") var __ToDt = FORMAT( MAXX( ALLSELECTED( DateTab[Date] ), DateTab[Date] ), "MMM DD, YYYY") RETURN "Report from " & __FromDt & " to " & __ToDtPage (and report filters for that matter) should be able to be accessed like any other type of filter.
Hope this helps
David