Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
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.
Solved! Go to 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.
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.
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
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.
User | Count |
---|---|
139 | |
113 | |
103 | |
73 | |
63 |
User | Count |
---|---|
136 | |
125 | |
107 | |
70 | |
61 |