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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
AshDil
Helper V
Helper V

Want to show Previous quarter Sales

Hi,

 

Now we are in 2022 Q1, I need to show previous quarter (2021 Q4) Sales. Like wise when we moved to 2022 Q2, need to show 2022 Q1 Sales......

I tried using following measures

Measure = calculate(Sum('Table'[sales]),Dateadd('Calendar'[Date],-1,Quarter))

and also with 

Measure = calculate(Sum('Table'[sales]), Previousquarter('Calendar'[Date]))

But unable to show 2021 Q4 sales.

Please help me to do it.

Thanks,

AshDil.

1 ACCEPTED SOLUTION

Hi @visheshjain ,

 

I have created Calendar table using CalendarAuto(), so it is having all the dates that contained in source tables. I have checked max date in Calendar table, which is 31 Dec 2022. 

So I have used following measure, it worked.

Measure =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER (
'Calendar',
'Calendar'[Date]
IN DATESINPERIOD ( 'Calendar'[Date], EOMONTH ( TODAY (), -1 ), -1, QUARTER )
)
)
Thanks,

AshDil.

 

View solution in original post

3 REPLIES 3
v-yetao1-msft
Community Support
Community Support

Hi @AshDil 

I am so glad to hear that you have solved your issue, please consider Accept it as the solution to help the other members find it more quickly.

 

Best Regard

Community Support Team _ Ailsa Tao

If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

visheshjain
Solution Supplier
Solution Supplier

Hi @AshDil ,

 

Please can you make sure that your calendar table is 'Marked as Date Table'.
Also, that the date table contains the dates that you are tying to do the calculation on.

 

Your measures look alright, so this is the only thing that I can think of as of now.

 

Hope this helps.

 

Thank you,

Vishesh Jain

Did I answer your question?
If yes, then please mark my post as a solution!

Thank you,
Vishesh Jain

Proud to be a Super User!



Hi @visheshjain ,

 

I have created Calendar table using CalendarAuto(), so it is having all the dates that contained in source tables. I have checked max date in Calendar table, which is 31 Dec 2022. 

So I have used following measure, it worked.

Measure =
CALCULATE (
SUM ( 'Table'[Sales] ),
FILTER (
'Calendar',
'Calendar'[Date]
IN DATESINPERIOD ( 'Calendar'[Date], EOMONTH ( TODAY (), -1 ), -1, QUARTER )
)
)
Thanks,

AshDil.

 

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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