Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hello everyone,
I am working with the price of many products and I need to create a measure that shows the average price of them. I have the following table
"PRESENTACION" are the name of the products, and "WALMART", "FARMACIAS DEL AHORRO", "FARMATODO", "FARMACIAS SAN PABLO" are the name of the columns that contains the prices of each product.
I need to create a measure that calculates the average of price of the products.
I tried with the average function but it calculates it by row.
What I need to do is like the last screen capture of excel but with a measure in power BI.
Hope you can help me.
Thank You.
Solved! Go to Solution.
@Anonymous -
Ideally, you would Unpivot the multiple separate columns into an Amount column and have another column which indicates the store.
As it stands now, you would need to refer to each column within a measure, like this:
Your Measure = var Total = SUM(YourTable[Walmart]) + SUM(YourTable[Store2]) + SUM ...... var ValueCount = IF(ISBLANK(SUM(YourTable[Walmart])),0,1) + IF(ISBLANK(SUM(YourTable[Store2])),0,1) + ...... return DIVIDE(Total,ValueCount)
Hope this helps,
Nathan
@Anonymous -
Ideally, you would Unpivot the multiple separate columns into an Amount column and have another column which indicates the store.
As it stands now, you would need to refer to each column within a measure, like this:
Your Measure = var Total = SUM(YourTable[Walmart]) + SUM(YourTable[Store2]) + SUM ...... var ValueCount = IF(ISBLANK(SUM(YourTable[Walmart])),0,1) + IF(ISBLANK(SUM(YourTable[Store2])),0,1) + ...... return DIVIDE(Total,ValueCount)
Hope this helps,
Nathan
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
100 | |
80 | |
64 | |
57 |
User | Count |
---|---|
146 | |
110 | |
93 | |
84 | |
67 |