March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early bird discount ends December 31.
Register NowBe one of the first to start using Fabric Databases. View on-demand sessions with database experts and the Microsoft product team to learn just how easy it is to get started. Watch now
Dear Team, need some help.
I have a Sales amount ranging from May 30' 2019 till Jan 01' 2017. How do I get the current quarter total sales and last quarter total sales? the previous quarter formula does not work.
Solved! Go to Solution.
Hi @Anonymous ,
You can create Quarter column first of all.
Quarter = ROUNDUP(MONTH(Table1[Date])/3,0)
Then create measures to get the current quarter total sales and last quarter total sales.
Total sales_current quarter = CALCULATE(SUM(Table1[sale]),FILTER(ALLSELECTED(Table1), Table1[Quarter] =MAX(Table1[Quarter])))
Total sales_last quarter = CALCULATE(SUM(Table1[sale]),FILTER(ALLSELECTED(Table1), Table1[Quarter] =MAX(Table1[Quarter])-1))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi @Anonymous ,
You can make this small change to the Quarter computation
Quarter =Year(Table1[Date])*4 + ROUNDUP(MONTH(Table1[Date])/3,0)
What this will result is a running serial number for the quarters from 8069 for Jan - March 2017 - 1st quarter and so on until 8079 - for Apr-May 2019 - 2 quarter.
Use the formula as suggested by @v-xicai for current quarter and previous quarter. It will work.
Check it out.
Cheers
CheenuSing
Hi Team,
I've same question i want to display the data for the current year and current quarter + the past 3 quarters for example if we are in 2025 and the current quarter is Q1 i want to display the period as 2025 Q1 and 2024 Q4, Q3 and Q2. i want to esnure that this code is sustanaible for every quarter.
Hi,
Try this:
Total sales = SUM(Data[Sales])
Total sales in previous quarter = CALCULATE([Total sales],PREVIOUSQUARTER('Calendar'[Date]))
Hope this helps.
@Ashish_Mathur Thanks.
I am not a using year and a quarter on my visual, it just a card that shows last quarter sales and in another card it shows current quarter sales.
I have tried the previous quarter formula by fixing it at the calendar date column, does not work.
Hi,
So if the Date column in your Data Table is till June 3, 2019, the the current quarter's revenue will be from April 1, to June 3. Am i correct?
Hi @Anonymous ,
You can create Quarter column first of all.
Quarter = ROUNDUP(MONTH(Table1[Date])/3,0)
Then create measures to get the current quarter total sales and last quarter total sales.
Total sales_current quarter = CALCULATE(SUM(Table1[sale]),FILTER(ALLSELECTED(Table1), Table1[Quarter] =MAX(Table1[Quarter])))
Total sales_last quarter = CALCULATE(SUM(Table1[sale]),FILTER(ALLSELECTED(Table1), Table1[Quarter] =MAX(Table1[Quarter])-1))
Best Regards,
Amy
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
I appreciate your genius solution!!
Dears,
Could you please answer
calculate = (Current Quarter Current Year) and (Last Quarter Previous Year)
Hi @Anonymous ,
You can make this small change to the Quarter computation
Quarter =Year(Table1[Date])*4 + ROUNDUP(MONTH(Table1[Date])/3,0)
What this will result is a running serial number for the quarters from 8069 for Jan - March 2017 - 1st quarter and so on until 8079 - for Apr-May 2019 - 2 quarter.
Use the formula as suggested by @v-xicai for current quarter and previous quarter. It will work.
Check it out.
Cheers
CheenuSing
This solved the issue of having quarters from different years.
Ex: Q1-2019 & Q1-2020. Using the solution marked in this post, will result in a overlap of both values from these quarters, since we're only looking for the Quarter number. By creating a serialized number, we avoid this overlap, since each quarter has a unique key.
Thanks, Amy for replying, actually below formula did not work reasons being.
1. The quarter formula converts as text by default but when I converted it to whole number it works.
2. now the max quarter gives me 4 but right now our max quarter is Q2, 2019. so the total sales values are coming wrong. Similarly, for last qaurter, it just gives 3. Maybe we need to fixed it with Year as well, but I tried and it does not work.
Any thoughts. Thanks.
March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!
Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.
Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.
User | Count |
---|---|
133 | |
91 | |
88 | |
64 | |
58 |
User | Count |
---|---|
201 | |
137 | |
107 | |
73 | |
68 |