Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Hello PBI Guru's,
I am attempting to calculate the average price of an item where the $ > 0 and averaged only by the distinct price and not the number of lines (records).
Image 1: Data structure
Image 2:
1. List of distinct gear charges
2. Sum of distinct gear charges
3. Correct, expected average of distinct prices.
I've searched and founda few similar posts but was not able to replicate that correct answer. Any help is greatly appreciated.
Solved! Go to Solution.
Calc := AVERAGEX ( SUMMARIZE ( 'Table', 'Table'[ProductName], 'Table'[Price] ), 'Table'[Price] )
Try this, just remplace 'Table' with your table name. This will create the unique list of products and prices, then using averagex, iterate over these to create the average price.
CALCULATE ( AVERAGEX ( SUMMARIZE ( 'Table' ,'Table'[ProductName] ,'Table'[Price] ) ,'Table'[Price] ) ,FILTER ( VALUES('Table'[Price]) ,NOT(ISBLANK('Table'[Price])) && 'Table'[Price] <> 0 ) )
Calc := AVERAGEX ( SUMMARIZE ( 'Table', 'Table'[ProductName], 'Table'[Price] ), 'Table'[Price] )
Try this, just remplace 'Table' with your table name. This will create the unique list of products and prices, then using averagex, iterate over these to create the average price.
Thank you, that's the format. I was trying it with the Averagex/Summarize swapped. Is there a place where I can only include > 0 records? No blanks or 0s
CALCULATE ( AVERAGEX ( SUMMARIZE ( 'Table' ,'Table'[ProductName] ,'Table'[Price] ) ,'Table'[Price] ) ,FILTER ( VALUES('Table'[Price]) ,NOT(ISBLANK('Table'[Price])) && 'Table'[Price] <> 0 ) )
@DataUsurper any chance you can share the data in text not image?
Proud to be a Super User!
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
63 |
User | Count |
---|---|
135 | |
126 | |
110 | |
70 | |
61 |