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.
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 😄
Regards!
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:
If still can’t see total value, for further test, could you please provide sample data with ‘dCalendar’ table?
Regards,
Jimmy Tao
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
97 | |
85 | |
68 | |
59 |
User | Count |
---|---|
150 | |
120 | |
99 | |
87 | |
68 |