Forum Discussion
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.
I've did some other testing but unsucefull
Well...hope someone can help me :D
Regards!
3 Replies
- andrejaarFrequent Visitor
- andrejaarFrequent Visitor
Is there any Extra data that i should provide for helping get a solution?
- v-yuta-msftCommunity Support
Hi andrejaar,
Firstly, please check if subtotals are set to “on” like below:
If still can’t see total value, for further test, could you please provide sample data with ‘dCalendar’ table?
Regards,
Jimmy Tao