Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
Dear All,
Im facing a issue while using SUMX funciton. I Wrote the below DAX statement to calculate the Avg price using SUMX function. I found that SUMX is not working for few Rows and returning wrong values.
Could somebody chack my logic and correct me if i made any mistakes in the DAX
Avg_price_Gram = SUMX(MT_Monthly_TertiarySales,DIVIDE(MT_Monthly_TertiarySales[Monthly Sales Amt],MT_Monthly_TertiarySales[Monthly Sales Unit Qty]* MT_Monthly_TertiarySales[Base Pack Qty]))
Brand Sale Amount Qty Gram Avg price per Gm
Thanks & Regards,
Rajeev Bikkani
Hi,
What result do you get with this?
=IFERROR(MT_Monthly_TertiarySales[Monthly Sales Amt]/(MT_Monthly_TertiarySales[Monthly Sales Unit Qty]* MT_Monthly_TertiarySales[Base Pack Qty]),BLANK())
Is the view you're showing us the Table view, the Data view, or is it a visual? Can we see the field names on the image?
Hi,
The screen shot which im showing is table visual. My
i need to do Avg price per gm = Monthly sales amt / (Monthly sales unit qty * Base pack qty) for each row. But my calculation is going wrong for many rows.
below is my DAX formula.
1_MT_Avg_price_Gram = SUMX(MT_Monthly_TertiarySales,DIVIDE(MT_Monthly_TertiarySales[Monthly Sales Amt],MT_Monthly_TertiarySales[Monthly Sales Unit Qty]* MT_Monthly_TertiarySales[Base Pack Qty]))
If you see the below screen shot most of the rows are showing wron values. Kindly help me to fix the issue
Thanks & Regards,
Rajeev
Just remove the SUMX and only use the divide function. by using SUMX you are summing the values in the column before performing the divide.
Is what you are showing the raw data and are you using the SUMX in a calculated column or a measure?
Hi ,
My Data is coming from Azure Analysis cube and im using a Table visulization to show the data. I have created a Mrasure to calculate the Avg.Price per grm. If i use SUM function my totals are coming working.
Thanks ,
Rajeev
User | Count |
---|---|
140 | |
113 | |
104 | |
77 | |
65 |
User | Count |
---|---|
136 | |
118 | |
101 | |
71 | |
61 |