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

Time Intelligence Quarters - Purchases

Hi,

My Goal is to know:

   - Quantiy bought in current quarter ( CALCULATE(Sum(fDados[Quantity]);DATESQTD(dCalendar[Date]))    )

   - Average Price Current Quarter ( CALCULATE(AVERAGE(fDados[Unit Pice]);DATESQTD(dCalendar[Date])) )

   - Aerage Price LAst Quarter ( CALCULATE(AVERAGE(fDados[Unit Pice]);PREVIOUSQUARTER(dCalendar[Date])) )

Calculation:

   If i have both products with purchases in both quarters,  than do the follwing:

     ( Current Av.Price * Current Quarter Quantity ) - ( Last Av.Price * Current Quarter Quantity )

 

I've done ton of trying...even got what i expected in the rows but the mesure was not doing total:

 

 

Total Diff = 
VAR Qty = CALCULATE(Sum(fDados[Quantity]);DATESQTD(dCalendar[Date]))

VAR Actual= CALCULATE(AVERAGE(fDados[Unit Pice]);DATESQTD(dCalendar[Date]))
VAR Last = CALCULATE(AVERAGE(fDados[Unit Pice]);PREVIOUSQUARTER(dCalendar[Date]))

VAR Total = IF( Actual> 0 && Last > 0 ;CALCULATE( (Actual* Qty ) - (Last *Qty ) ) ; BLANK())
RETURN IF(HASONEVALUE(fDados[Product]);Total;BLANK())

 

 

the problem is that it do not compute Total(sum)... onyl shows the values in the matrix.

total.JPG

 

I've did some other testing but unsucefull

Well...hope someone can help me 😄

 

Regards!

3 REPLIES 3
andrejaar
Frequent Visitor

Is there any Extra data that i should provide for helping get a solution?

Hi andrejaar,

 

Firstly, please check if subtotals are set to “on” like below:

 111.png

If still can’t see total value, for further test, could you please provide sample data with ‘dCalendar’ table?

 

Regards,

Jimmy Tao

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.