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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. 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
v-bofeng-msft
Community Support
Community Support

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
v-bofeng-msft
Community Support
Community Support

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
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.