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

Be 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

Reply
StevenT
Resolver I
Resolver I

unable to change calculation when changing from month over month to qtr over qtr & yr over yr

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 

StevenT_1-1728415640020.png

When I switch it to Qtr over Qtr and Yr over Yr, the calculations are failing.
(Please ignore the headers)

StevenT_2-1728415854040.png

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.

StevenT_3-1728416062492.png

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

StevenT_9-1728416921415.png

This second measure  checks to see which calendar type is chosen from the drop down. 
For this example, I'm choosing QTR

StevenT_13-1728417527498.png

 

Finally, the third one should be the result i would like to see in the report
StevenT_16-1728417757030.png

From this information can you determine what I'm doing wrong?


Thanks, Steve

 

 

 

 

2 ACCEPTED SOLUTIONS

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

StevenT_0-1728570687893.png

Switching it from matrix to table doesn't change the %

StevenT_1-1728570794334.png

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...



View solution in original post

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!

View solution in original post

5 REPLIES 5
AllisonKennedy
Super User
Super User

@StevenT 

 

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?


Please @mention me in your reply if you want a response.

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

StevenT_0-1728570687893.png

Switching it from matrix to table doesn't change the %

StevenT_1-1728570794334.png

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!

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Dec Fabric Community Survey

We want your feedback!

Your insights matter. That’s why we created a quick survey to learn about your experience finding answers to technical questions.

ArunFabCon

Microsoft Fabric Community Conference 2025

Arun Ulag shares exciting details about the Microsoft Fabric Conference 2025, which will be held in Las Vegas, NV.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.