Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

July 7 - July 17 | Round 2 of the Power BI Dataviz World Championships. Don't miss your chance! Learn more

Reply
vicsinc
Frequent Visitor

Calculated average value within filtered parameters

I am trying to create a visual which shows actual cost per sale by brand against target, filterable by month and by brand.

 

I am struggling with the DAX for the measure for the true cost per sale over a filtered period of time - ie it is the sum of the spend for those months divided by the sum of the sales for those months. I thought it would be straight forward but nothing I've tried works.

 

Here's the sample data. I'd really appreciate any help as I have a total mind block with this now.

 

BrandMonthSpendSalesCPSTarget
Brand1Jan-22£16,505.46985£16.76£21.00
Brand1Feb-22£7,558.00845£8.94£21.00
Brand2Jan-22£5,632.64183£30.78£67.00
Brand2Feb-22£1,972.25110£17.93£67.00
Brand3Jan-22£16,413.63614£26.73£52.00
Brand3Feb-22£8,211.31427£19.23£52.00

 

Many thanks

 

 

Victoria

3 REPLIES 3
v-yanjiang-msft
Community Support
Community Support

Hi @vicsinc ,

Does your problem been solved by @amitchandak 's solution, if yes, please consider accept it as the solutionto help the other members find it more quickly. If not, could you please show your expected result?

Best Regards,
Community Support Team _ kalyj

amitchandak
Super User
Super User

@vicsinc , Try a measure like

 

avergageX(Values('Date'[Date]), calculate(sum(Table[Spend])))

Share with Power BI Enthusiasts: Full Power BI Video (20 Hours) YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

THank you for your help!

Helpful resources

Announcements
FabCon and SQLCon Barcelona 2026

FabCon & SQLCon – Barcelona 2026

Join us in Barcelona for FabCon and SQLCon, the Fabric, Power BI, SQL, and AI community event. Save €200 with code FABCMTY200.

60 days of Data Days Carousel

Data Days 2026

Join Fabric Data Days 2026: 60 days of free live/on-demand sessions, challenges, study groups, and certification opportunities.

Power BI DataViz World Championships carousel

Power BI DataViz World Championships - June 2026

A new Power BI DataViz World Championship is coming this June! Don't miss out on submitting your entry.