DAX AverageX

dicken

Active Member
Joined
Feb 12, 2022
Messages
292
Office Version
  1. 365
Platform
  1. Windows
Hi,
I'm having a problem understanding what I'm doing wrong;

I have a measure for Revenue;

<
SUMX(fTransactions,

fTransactions[UnitsSold]*(1- fTransactions[Discount])*RELATED(dProduct[RetailPrice]) ) >

This works, and then I wanted the average so; (dDate = date table)

< AVERAGEX ( dDate, [Revenue] ) >

This also works, but for practice I'd like to actually type it all out rather than using the measure within AVERAGEX,
So thought,

< AVERAGEX( dDate, CALCULATE (
SUMX(fTransactions, fTransactions[UnitsSold]*(1- fTransactions[Discount])*RELATED(dProduct[RetailPrice]) ) >

Would work, but I get continual errors highlighted, I've tried not using Calculate but am a bit stuck.

Richard.
 

Excel Facts

Spell Check in Excel
Press F7 to start spell check in Excel. Be careful, by default, Excel does not check Capitalized Werds (whoops)
Thanks Matt, ( I do have your book), unfortunately that only half worked, yes I no longer get an error but the when dropped
into a 'card' in visualizations, they don't show the same figure. I did cut and paste the formula,
Any suggestions as to what I'm doing wrong?

Richard.
 
Upvote 0
Your missing 2 closing brackets at the end. Use daxformatter.com when you are stuck like this
Ignore other email, in my slap dash manner I forgot to wrap in 'calculate' .
BTW I like your book, but there's a 'but' coming, and that's I'd have liked more on using Calculate with filter, and context
transition but I'd recommend it.

Richard.
 
Upvote 0

Forum statistics

Threads
1,223,886
Messages
6,175,191
Members
452,616
Latest member
intern444

We've detected that you are using an adblocker.

We have a great community of people providing Excel help here, but the hosting costs are enormous. You can help keep this site running by allowing ads on MrExcel.com.
Allow Ads at MrExcel

Which adblocker are you using?

Disable AdBlock

Follow these easy steps to disable AdBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the icon in the browser’s toolbar.
2)Click on the "Pause on this site" option.
Go back

Disable AdBlock Plus

Follow these easy steps to disable AdBlock Plus

1)Click on the icon in the browser’s toolbar.
2)Click on the toggle to disable it for "mrexcel.com".
Go back

Disable uBlock Origin

Follow these easy steps to disable uBlock Origin

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back

Disable uBlock

Follow these easy steps to disable uBlock

1)Click on the icon in the browser’s toolbar.
2)Click on the "Power" button.
3)Click on the "Refresh" button.
Go back
Back
Top