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 September 15. Request your voucher.
Good morning,
I am trying to compute a monthly average consumption per customer per selling point,
what I would like to have is, for a given selling point, for a given month, how much is the average consumption per customer?
I used:
The problem is that if I make a matrix for a given selling point, and a given month (and year), the average in some cases changes across the customers, but I don't understand why
can anybody help me?
thanks very much
Davide
AvgSales should be simply AVERAGEX( Customers, [Consumption] ), where [Consumption] is the measure [Consumption] := SUM ( 'IT trans cc vegacrm2'[Sale_value] ). The rest is done through suitable slicing.
First of all, thank you daxer for your answer, I then tried
[Consumption] must be a measure. Your formula does not work because SUM(...) is an expression, not a measure. If you want to use an expression, you must wrap it in CALCULATE that does the necessary context transition. Also, the outer CALCULATE is not needed when defining AvgSales. Moreover, you can't use a naked column under AVERAGEX as the first argument. You have to retrieve values of the column through a table expression. For instance, VALUES or DISTINCT.
User | Count |
---|---|
15 | |
13 | |
8 | |
6 | |
6 |
User | Count |
---|---|
27 | |
19 | |
12 | |
9 | |
5 |