Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
sreddy47652
Helper III
Helper III

Based on year selection to show previous quarter

Hi Team, I have directquery model and i need to show based on year selection on slicer i want show ouarter wise and  for example 2024 q1 should show value for 2023 Q4, if 2024 Q2 the value should show 2023 Q1 value like below. I need to show result like below query.

sreddy47652_0-1725978280272.png

 

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @sreddy47652 ,

 

I’ve made a test for your reference:

1\I assume there is a table

vbofengmsft_0-1726219626811.png

 

2\Create a measure

 

NewSumOfValue =

 CALCULATE(

    MAX(Table1[Value]),

    REMOVEFILTERS(Table1),

    (Table1[Year] = (MAX(Table1[Year]) - 1) && Table1[Quarter] = 4) ||

    (Table1[Year] = MAX(Table1[Year]) && Table1[Quarter] = (MAX(Table1[Quarter]) - 1))

)

 

3\Result

vbofengmsft_1-1726219643712.png

 

vbofengmsft_2-1726219643713.png

 

 

Best Regards,

Bof

View solution in original post

3 REPLIES 3
Anonymous
Not applicable

Hi @sreddy47652 ,

 

I’ve made a test for your reference:

1\I assume there is a table

vbofengmsft_0-1726219626811.png

 

2\Create a measure

 

NewSumOfValue =

 CALCULATE(

    MAX(Table1[Value]),

    REMOVEFILTERS(Table1),

    (Table1[Year] = (MAX(Table1[Year]) - 1) && Table1[Quarter] = 4) ||

    (Table1[Year] = MAX(Table1[Year]) && Table1[Quarter] = (MAX(Table1[Quarter]) - 1))

)

 

3\Result

vbofengmsft_1-1726219643712.png

 

vbofengmsft_2-1726219643713.png

 

 

Best Regards,

Bof

Tahreem24
Super User
Super User

  Try this DAX Measure:Last year same QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,Year)))

  

@sreddy47652

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

@Tahreem24  As i mentioned it's directquery mode and time intelligence functions will not work.

Helpful resources

Announcements
June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

May 2025 Monthly Update

Fabric Community Update - May 2025

Find out what's new and trending in the Fabric community.