Forum Discussion
Time Intelligence in Power BI with Buttons
- Anonymous5 years ago
Hi Everyone,
Here is the solution that I have found to work. I hope someone finds this useful. I will give credit to the freelancer who came up with this at the end of the post.
End Result:
You will have one slicer for the current period and one slicer for the previous period. You can compare any range of dates to one another by selecting your date range in the corresponding slicer. In the photo below the current period slicer is showing 6/1/2021-6/30/2021 and the previous period slicer is showing 5/1/2021-5/31/2021. The light blue line is showing the current period and the dark blue line is showing the previous period in the visuals.Step 1:
Create a new measure called "Previous Date Selector" and use your date table as the parameter value.
Step 2:
Create an inactive one too many relationship between your "Previous Date Selector" and regular date table.
Step 3:
Create a slicer from your standard date table and name it "current period" and create a slicer from your "previous date selector" and name it "previous period."
Step 4:
Create a measure with the following dax. In this case, I am comparing total sessions in the current period to total sessions in the previous period so I am using the "total sessions" value.
Step 5
Add your two values to the visual you would like to use to compare the current period to the previous period. In this case, I am comparing total sessions from google analytics so I have a measure for "total sessions", which is synched to the current period slicer and a measure for "total visitors for previous period", which is synched to the previous period slicer.
I hope this helps someone!
Freelancer: andystepas | Profile | Fiverr
The simplest way to do that (assuming your have your 3 DAX expressions to get 1, 3, and 12 mo comparisons) would be to make a calculation group. You could then put the calc group in a slicer so the user could choose the time frame to compare.
If you really need buttons, you can do that with bookmarks and make 3 versions of the visual that overlap and set up the bookmarks with only one version showing at a time.
Pat
- Anonymous5 years agoNot applicable
Hi mahoneypat
thank you for the response.
If you think the solution that is posted above is useful please consider accepting it as a solution.
Thank you,
Joshua Cortigiano