average value for aggregated variable, DAX, Power bi
How to calculate the average price as in the last column, so that this average is calculated for each unique connection of the first 4 columns.
As I want->
1.Example-date 10.08.2020+customer#123+store#10+size 4->(10+20)/2=15.
2. Example - 12.08.2020+customer#124+store#12+size 6->(10+20+30)/3=20. I tried many options, of which only two gave an approximate result, but all the same is not what you need.
avg1 = CALCULATE (AVERAGE ('Table'[price] ),ALLEXCEPT ( Table, 'Table'[date of purchase], 'Table' [client_id], 'Table' [number of shop],'Table' [size] ))
avg2 = AVERAGEX (ALLSELECTED ( 'Table'[date of purchase], 'Table' [client_id], 'Table' [number of shop],'Table' [size],'Table'[price] ), VALUE( 'Table'[price]))
0