cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
J_Barker
Frequent Visitor

Get Previous Quarter with Selected Quarter Slicer

I am looking to set up a graph that has dates on the x-axis that are in the currently selected quarter (using a slicer) as well as the previous quarter. If Q3 2022 is selected, the graph should range from 4/1/2022 to 9/30/2022.

1 ACCEPTED SOLUTION
J_Barker
Frequent Visitor

I was able to format the existing date slicer and the detached yearquarter slicer the same and then group/sync them. Now when I change the date slicer, it changes the detached slicer to the same value and gives me the desired result. From there, I can just hide the detached slicer and continue using the date slicer like normal.

View solution in original post

4 REPLIES 4
J_Barker
Frequent Visitor

I was able to format the existing date slicer and the detached yearquarter slicer the same and then group/sync them. Now when I change the date slicer, it changes the detached slicer to the same value and gives me the desired result. From there, I can just hide the detached slicer and continue using the date slicer like normal.

lbendlin
Super User
Super User

ok.  what is your question?  What have you tried and where are you stuck?

My question is how to set this up? I've tried using datediff and rank functions, but the issue I am running into is that it needs to be based on what is currently selected and return that quarter plus the previous quarter. If the quarter changes, the two quarters displayed need to change as well.

 

Edit: I just tried a solution that was suggested on another post ( Solved: Re: Show previous three quarters based on quarter ... - Microsoft Power BI Community ) and was able to get it to work using the separate year/quarter string table. I guess my new question is why can't I get it to work from the original date table provided the interactions are turned off? Ideally, I'd like to avoid having to break with the date table as their are other measures on the page that use the current yearquarter slicer.

Interactions are only affecting visuals. Your desired effect impacts the data model. You need to use disconnected tables to feed the slicer, and/or create special measures.

Helpful resources

Announcements
PBI Sept Update Carousel

Power BI September 2023 Update

Take a look at the September 2023 Power BI update to learn more.

Learn Live

Learn Live: Event Series

Join Microsoft Reactor and learn from developers.

Dashboard in a day with date

Exclusive opportunity for Women!

Join us for a free, hands-on Microsoft workshop led by women trainers for women where you will learn how to build a Dashboard in a Day!

MPPC 2023 PBI Carousel

Power Platform Conference-Power BI and Fabric Sessions

Join us Oct 1 - 6 in Las Vegas for the Microsoft Power Platform Conference.

Top Solution Authors