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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
becky_yoo
Frequent Visitor

Need help on calculating previous quarter value and current quarter value delta

Hi,

I'm trying to calculate delta between previous quarter and current quarter Turns (please see below).

However, it just shows me -FY-FQ value only.

What I want to do is in Turns Delta column, when UOM="$", Previous QTR-FY-FQ

Can you help me?

Thank you

 

Turns Delta =
var cost_current_qtr=CALCULATE(sum('Delta DIO and Turns'[Turns]),'Delta DIO and Turns'[UOM]="$")
var cost_previous_qtr=calculate(sum('Delta DIO and Turns'[Turns]),'Delta DIO and Turns'[FY-FQ]='Delta DIO and Turns'[Preious QTR])
return
cost_previous_qtr-cost_current_qtr

 

becky_yoo_0-1675716394360.png

 

2 REPLIES 2
becky_yoo
Frequent Visitor

Hi @amitchandak 

Thank you for your solution.

Unfortunately, the only date info I have is quarter. I have column show quarter and its previous quarter. 

I think 

var cost_previous_qtr=calculate(sum('Delta DIO and Turns'[Turns]),'Delta DIO and Turns'[FY-FQ]='Delta DIO and Turns'[Preious QTR])

 

this is not working well. Can you see the issue on my DAX above?

 

Thank you 

amitchandak
Super User
Super User

@becky_yoo , if you have date you can use date table and time intelligence( date of date tbale will join with date of your tables)

 


QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(('Date'[Date])))
Last QTD Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(dateadd('Date'[Date],-1,QUARTER)))


Qtr Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD(ENDOFQUARTER('Date'[Date])))

Last QUARTER Sales = CALCULATE(SUM(Sales[Sales Amount]),DATESQTD( ENDOFQUARTER(dateadd('Date'[Date],-1,QUARTER))))

 

 

Power BI — Qtr on Qtr with or Without Time Intelligence
https://medium.com/@amitchandak.1978/power-bi-qtd-questions-time-intelligence-2-5-d842063da839
https://www.youtube.com/watch?v=8-TlVx7P0A0

 

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

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.