Forum Discussion
Monthly averages - Calculated column - Aggregation
- 1 year ago
Hi Cro-Magnon,
To fix this, you can use an below measure that calculates the percentage correctly by summing up the values at the level you want.
Dax Measure :STD_Percentage_XX = DIVIDE([TotalProducts_XX], [STD_Products_XX], 0 )
the expected output as below :
This measure works with the aggregated totals instead of individual row context, providing the correct percentage of standard products.If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.
If you continue to face issues, feel free to reach out to us for further assistance!
Hello,
I am not quite sure what exactly you are trying to calculate - Average by date, or Average by month? In either case, you could consider the following:
Measure =
VAR _Percent = DIVIDE([STD Products],[Total Products],0)
RETURN
CALCULATE(_Percent,ALLEXCEPT(DateTable,DateTable[Month])- Cro-Magnon1 year agoRegular Visitor
Hi,
that does not work because of the step:VAR _Percent = DIVIDE([STD Products],[Total Products],0)
is a row by row calculation and therefore, for any given row, it will always be 1 if the product is standard. That is exact issue I'm struggling with. You can test it with the mockup table in my original post.- v-aatheeque1 year agoCommunity Support
Hi Cro-Magnon,
To fix this, you can use an below measure that calculates the percentage correctly by summing up the values at the level you want.
Dax Measure :STD_Percentage_XX = DIVIDE([TotalProducts_XX], [STD_Products_XX], 0 )
the expected output as below :
This measure works with the aggregated totals instead of individual row context, providing the correct percentage of standard products.If this post was helpful, please consider marking Accept as solution to assist other members in finding it more easily.
If you continue to face issues, feel free to reach out to us for further assistance!
- v-aatheeque1 year agoCommunity Support
Hi Cro-Magnon ,
If our response addressed your query, please mark it as Accepted Answer and click Yes if you found it helpful.
Should you have any further questions, feel free to reach out.
Thank you for being a part of the Microsoft Fabric Community Forum!