The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredCompete to become Power BI Data Viz World Champion! First round ends August 18th. Get started.
Lo All,
I have a correct measure for my weighted average but when I attempt to related our orders w/ a delta calc that wAverage recalcs per order. How can I maintain the static weighted average when applying OrderID Context (see images):
wAvg_Actual = CALCULATE(SUMX(TBLDATA,((TBLDATA[QTY]*TBLDATA[BILL_DAYS])/7)*TBLDATA[Actual_Price.Disc])/SUMX(TBLDATA,((TBLDATA[BILL_DAYS]/7)*TBLDATA[QTY])),TBLDATA[Actual_Price.Disc]>0)
Thank you kindly
Solved! Go to Solution.
Was able to get this to work using "ALLExcept" but I also need a secondary filter for when a field is > 0
wAvg_Actual = CALCULATE(SUMX(TBLDATA,((TBLDATA[QTY]*TBLDATA[BILL_DAYS])/7)*TBLDATA[Actual_Price.Disc])/SUMX(TBLDATA,((TBLDATA[BILL_DAYS]/7)*TBLDATA[QTY])),ALLEXCEPT(TBLDATA,TBLDATA[E.CODE]))
Was able to get this to work using "ALLExcept" but I also need a secondary filter for when a field is > 0
wAvg_Actual = CALCULATE(SUMX(TBLDATA,((TBLDATA[QTY]*TBLDATA[BILL_DAYS])/7)*TBLDATA[Actual_Price.Disc])/SUMX(TBLDATA,((TBLDATA[BILL_DAYS]/7)*TBLDATA[QTY])),ALLEXCEPT(TBLDATA,TBLDATA[E.CODE]))
User | Count |
---|---|
28 | |
11 | |
8 | |
6 | |
5 |
User | Count |
---|---|
35 | |
14 | |
12 | |
9 | |
7 |