Microsoft is giving away 50,000 FREE Microsoft Certification exam vouchers!
Enter the sweepstakes now!Prepping for a Fabric certification exam? Join us for a live prep session with exam experts to learn how to pass the exam. Register now.
In this article, I would like to demonstrate a scenario of showing Quarterly data in a simple column chart. However with an added requirement to identify when a quarter is not complete and also show the latest and previous quarter's data accordingly.
So, below is what we need:
lets try to break down the problem and try to understand the critical requirements.
1. the data is monthly and need to show the previous quarter's data. Hence, we definitely need a date dimension table.
2. Since need to do some quarterly calculations, hence need some specific columns in the date dimension table
3. Once those columns were created, next challenge was to update the x-axis quarter values. If the Quarter is not complete (i.e. if we have data lets say upto Feb, then show partial)
4. Next step is to if current quarter is partial then show partial in the quarter name for same quarter last year too.
5. Final step is if the current quarter is partial, then for same quarter last year, update the calculation to show only upto those months. i.e. if for current quarter we have data upto April'25, then for 2024, 2nd quarter show only data upto April'24 (for 2nd quarter) for a true comparison; as comparing a partil and full quarter will not give a real insight of the data.
I tried to create a simple dataset to demonstrate the solution. Below is the monthly Sales table.
Now, lets create a date dimension table using Power query. We can use the organization's standard date dimension or may create one using Power Query. I have attached the M query for the date dimension, however few columns are required we will mention below.
Need QuarterID (e.g. 202501 for 1st 3 months of the 2025), End of Quarter Month id (e.g. 202503 for 1st 3 months of 2025), MonthQuarterNo (e.g. month no in a quarter like 1,2,3 for Jan, Feb, Mar for 1st Quarter & again 1,2,3 for Apr, May, Jun for 2nd Quarter) .
I created some measures and additional columns also (pbix file attached).
below column will give Quarter values in display format:
And when we have data upto April 25
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.