DAX AverageX

dicken

Active Member
Joined
Feb 12, 2022
Messages
280
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

Ambidextrous Undo
Undo last command with Ctrl+Z or Alt+Backspace. If you use the Undo icon in the QAT, open the drop-down arrow to undo up to 100 steps.
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,214,924
Messages
6,122,294
Members
449,077
Latest member
Rkmenon

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