Forum Discussion
Dax for Last viewed page
Hi,
I have a Power BI report with 6 pages, and I want to create a breadcrumb that shows which page I last visited. For example, I am on the page first and I jump to the sixth page of the report, I want to show which was the last page I visited (which was the first page).
Is there a way to create a Dax or a tracker for this in the report?
I am using a Parameterized URL to navigate from one page of the report to another.
6 Replies
- grazitti_sapna
Super User
Hi Jayshikha_06,
You can create a table with page names first:- below is the dax
PageTracker =
DATATABLE (
"PageName", STRING,
{
{"Page 1"},
{"Page 2"},
{"Page 3"},
{"Page 4"},
{"Page 5"},
{"Page 6"}
}
)Now you can store the previously visited page name in a measure and use it in your KPI card to show last visited page. Use below dax
LastVisitedPage =
VAR CurrentPage = SELECTEDVALUE(PageTracker[PageName])
VAR PreviousPage =
CALCULATE(
MAX(PageTracker[PageName]),
FILTER(ALL(PageTracker), PageTracker[PageName] <> CurrentPage)
)
RETURN
IF(ISBLANK(PreviousPage), "No previous page", PreviousPage)🌟 I hope this solution helps you unlock your Power BI potential! If you found it helpful, click 'Mark as Solution' to guide others toward the answers they need.
💡 Love the effort? Drop the kudos! Your appreciation fuels community spirit and innovation.
🎖 As a proud SuperUser and Microsoft Partner, we’re here to empower your data journey and the Power BI Community at large.
🔗 Curious to explore more? [Discover here].
Let’s keep building smarter solutions together! - Jayshikha_06New Member
I am not using a slicer to navigate through pages. On the desktop I am navigating through the basic navigation below tabs but as I have mentioned. I need to navigate through the Parameterized URL.
- AnonymousNot applicable
Hi Jayshikha_06,
Thanks for reaching out to the Microsoft fabric community forum.
It looks like you are facing issues while navigating through Parameterized URLs, Power BI does not natively track the last visited page across sessions. But, you can achieve this by modifying the URL structure to pass the last visited page as a parameter and then extracting it in Power BI using Power Query.
Instead of using: "https://app.powerbi.com/groups/<workspace_id>/reports/<report_id>?pageName=Page2", you can try "https://app.powerbi.com/groups/<workspace_id>/reports/<report_id>?pageName=Page2&lastPage=Page1". This will pass "Page 1" as the last visited page when navigating to "Page 2".
I would also take a moment to thank grazitti_sapna, for actively participating in the community forum and for the solutions you’ve been sharing in the community forum. Your contributions make a real difference.
If I misunderstand your needs or you still have problems on it, please feel free to let us know.
Best Regards,
Hammad.
Community Support TeamIf this post helps then please mark it as a solution, so that other members find it more quickly.
Thank you.
- AnonymousNot applicable
Hi Jayshikha_06,
As we haven’t heard back from you, so just following up to our previous message. I'd like to confirm if you've successfully resolved this issue or if you need further help.
If yes, you are welcome to share your workaround and mark it as a solution so that other users can benefit as well. If you find a reply particularly helpful to you, you can also mark it as a solution.
If you still have any questions or need more support, please feel free to let us know. We are more than happy to continue to help you.
Thank you for your patience and look forward to hearing from you.- AnonymousNot applicable
Hi Jayshikha_06,
I wanted to check if you had the opportunity to review the information provided. Please feel free to contact us if you have any further questions. If my response has addressed your query, please accept it as a solution so that other community members can find it easily.
Thank you.