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
garrettmindrup
Frequent Visitor

Quarter over Quarter variance measure/column for table with quarter end amounts by account.

I have a table that lists quarter-end account balances by account and business group and I'd like to create a measure or column that shows the quarter-over-quarter balance change for each company/account combo (e.g., Group A, Account 10000 quarter-over-quarter change is $500 in Q2).

 

I've tried various formulas using the calculate function, but these don't work if I don't apply aggregation (SUM and SUMX are what I've tried) to the AMOUNT column. The aggregations seem to mess up the results. I either get blank values or duplicate amount values. I think it's because the amounts don't need to be aggregated. They're already aggregated values.

 

How can I do a simple subtraction based on quarterly dates without having to aggregate my amount column?

 

The formula(and similar variations) I've tried:

 

VAR CurrentAmt = TABLE1[AMOUNT]
VAR PrevAmt = CALCULATE(SUM(TABLE1[AMOUNT]), PREVIOUSQUARTER(TABLE1[DATE].[DATE])
RETURN = CurrentAmt - PrevAmt

 

Table example:

GroupAccountQ End AmountQuarter
A100000$20003/31/22
A200000$30003/31/22
B100000$40003/31/22
B200000$50003/31/22
4 REPLIES 4
khtan518
New Member

Hi @garrettmindrup  - Did you manage to resolve this? If so, could you please share the solution? 

Hi @khtan518 , I have not found a solution yet. 

 

amitchandak
Super User
Super User

@garrettmindrup , Always use date table marked as date table joined with your table

 

VAR CurrentAmt = TABLE1[AMOUNT]
VAR PrevAmt = CALCULATE(SUM(TABLE1[AMOUNT]), PREVIOUSQUARTER(Date[DATE])
RETURN = CurrentAmt - PrevAmt

 

Also do not use .Date

 

Why Time Intelligence Fails - Powerbi 5 Savior Steps for TI :https://youtu.be/OBf0rjpp5Hw
https://amitchandak.medium.com/power-bi-5-key-points-to-make-time-intelligence-successful-bd52912a5b...
To get the best of the time intelligence function. Make sure you have a date calendar and it has been marked as the date in model view. Also, join it with the date column of your fact/s. Refer :radacad sqlbi My Video Series Appreciate your Kudos.

 

Time Intelligence, Part of learn Power BI https://youtu.be/cN8AO3_vmlY?t=27510
Time Intelligence, DATESMTD, DATESQTD, DATESYTD, Week On Week, Week Till Date, Custom Period on Period,
Custom Period till date: https://youtu.be/aU2aKbnHuWs&t=145s

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Thanks, @amitchandak. I tried your solution and did not get the result I was expecting. 

Here's what I did:

  • Created a date table and marked it as a date table
  • Created a relationship between the [Date] column in my date table and the [Quarters_Column] column in my accounts table (Originally ref'd as table1[Date] above). 
  • Used the DAX formula you referenced, utilizing the [Date] field from the date table. 

 

Quarterly_Change = 
VAR PREVAMOUNT = CALCULATE(SUM(AccountBalances[Period Value in Group Currency]), PREVIOUSQUARTER(Date_Table[Date]))
VAR CURRAMOUNT = AccountBalances[Period Value in Group Currency]
RETURN CURRAMOUNT - PREVAMOUNT 

 
The results are returning the current quarter amount rather than the variance from the previous quarter. The below screenshot shows an example. I'm wanting it to calculate ($2,329,916.31) - $4,429,234.68 and return $(6,759,150.99). 

garrettmindrup_0-1676405722051.png

Any idea on what else I could try? 

 

Additional screenshots:
Date table:

garrettmindrup_1-1676406053847.png

 

Relationship between Amounts Table and Date Table:

garrettmindrup_2-1676406113630.png

 




 

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.