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
I'm having trouble with Qtr Over Qtr and Yr over Yr, but NOT Mth over Mth.
Here's my Month over month calculations. The calcs are working
When I switch it to Qtr over Qtr and Yr over Yr, the calculations are failing.
(Please ignore the headers)
because this isn't working I don't have a calendar range set up yet. But I do have drop down that has three options, Month Quarter Year. In this example when I change it to QTR, you can see that the calendar is reflecting that but the calcs are wrong.
Here are my measures that I'm using. Mth is working and Qtr and year are not.
This first set is each calculation by Mth Qtr and Yr
From this information can you determine what I'm doing wrong?
Thanks, Steve
Solved! Go to Solution.
Hi Allison. This is what I've discovered.
My matrix seems to be incorrectly calculating the %
For example, here is the matrix of one record
390/39 of course is not = to 1009.40
Switching it from matrix to table doesn't change the %
So it looks like the error is some how occuring before the data is actually posted into the visual. Rounding errors maybe?
Do you have any suggestions for me on resolving this?
Thanks...
Well simply put, I had a number of different measures calling each other and one of them was out of sync with the others. So matter what else i would have done or y'all you could have given me without fixing the issue with one of my measures, I would have wasted yours and my time.
So it was a mistake that I corrected. Thanks!
A couple of things here -
1) we can't ignore the headers
The reason your calcs work for month on month is because you have Month in the columns of the matrix, so your visual has a filter context applied for month. When you do a quarter calc in here, using the PREVIOUSQUARTER function, you are dividing an entire quarter of data (using the 1Qtr measure with the PREVIOUSQUARTER function) by only 1 month of data (using the SUM( salesamount) in your measure 2).
What do you want to happen when you select Quarter? Do you want the headings to change to quarter instead of month? If so, you'll need to use field parameters and some DAX measure filters to make this work.
Let report readers use field parameters to change visuals (preview) - Power BI | Microsoft Learn
Or do you want to compare the month in the header of the matrix to the corresponding month in the previous quarter? If that's the case, you'll want to use a different time intelligence function. DATEADD - DAX Guide DateADD is my favorite function. It shifts the selected time period, keeping the same number of days when it does the shift. It can shift by month, quarter, year, or even day. There are plenty of other time intelligence functions you could explore: Time Intelligence - DAX Guide
Note the PREVIOUSQUARTER measure returns the FULL quarter in the quarter prior to the start of your current filter context PREVIOUSQUARTER - DAX Guide
Hopefully that helps you some?
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
Hi Allison. This is what I've discovered.
My matrix seems to be incorrectly calculating the %
For example, here is the matrix of one record
390/39 of course is not = to 1009.40
Switching it from matrix to table doesn't change the %
So it looks like the error is some how occuring before the data is actually posted into the visual. Rounding errors maybe?
Do you have any suggestions for me on resolving this?
Thanks...
Hi Allison! I was able to resolve this on my own! Thanks
Hi @StevenT
I'm glad to know that your problem was resolved. Could you please share your solution? This will help other users experiencing similar problems to benefit from it.
Thank you in advance for your time and cooperation.
Best Regards,
Jarvis Tang
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Well simply put, I had a number of different measures calling each other and one of them was out of sync with the others. So matter what else i would have done or y'all you could have given me without fixing the issue with one of my measures, I would have wasted yours and my time.
So it was a mistake that I corrected. 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 |
---|---|
124 | |
89 | |
84 | |
70 | |
51 |
User | Count |
---|---|
206 | |
146 | |
97 | |
79 | |
69 |