The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hi,
I am trying to create a cost report that will display weekly costs by associated product measured against data set avg.
The bit I am stuck on is getting the Weekly AVG price and qty purchased to stay as is in the measure when I add the month into the filter conext.
I'm new(ish) to DAX and the only measures that I was able to create were -
QTY_Purchased=CALCULATE(SUM(FUEL_REPORT[Quantity]),
FILTER(FUEL,FUEL[Key]=7||FUEL[Key]=8||FUEL[Key]=16||FUEL[Key]=20),
FILTER(Site_FUELS,Site_FUELS[SITE]="SHELL"))
and
AVG Prrice=AVERAGEX(VALUES(Date_lookup[WeekNum]),[AVG Diesel])
These two don't work as as soon as I change week to month, it averages the month (as it should) and I don't know how to make those values static to multiply them by each other to get the sum monthly cost.
@CHMay4253 , Try like
AVG Prrice=calculate(AVERAGEX(VALUES(Date_lookup[WeekNum]),[AVG Diesel]), removefilters(Date_lookup[WeekNum]))
or
AVG Prrice=calculate(AVERAGEX(VALUES(Date_lookup[WeekNum]),[AVG Diesel]), allselected(Date_lookup[WeekNum]))
Hi,
That still gives me a monthly or yearly average depending on the filter context.
User | Count |
---|---|
78 | |
74 | |
43 | |
32 | |
28 |
User | Count |
---|---|
104 | |
93 | |
51 | |
51 | |
46 |