JimMatthews
New Member
- Joined
- Aug 12, 2014
- Messages
- 9
Hi, I have a question with a sub total percentages problem.
I have done what I want and it is working as I want.
As you can see from this image, https://www.dropbox.com/s/9m3su0l2lcstvcr/subtotals.png
the 1, 2 and 3 KG sub totals add up to 100%. Also, when I drill into one of the pack sizes, the percentages add to 100% for that pack size - this is exactly what I want.
My question is, is there any 'easier' and 'better' DAX to get this result other than what I have created here.
Thanks
I have done what I want and it is working as I want.
As you can see from this image, https://www.dropbox.com/s/9m3su0l2lcstvcr/subtotals.png
the 1, 2 and 3 KG sub totals add up to 100%. Also, when I drill into one of the pack sizes, the percentages add to 100% for that pack size - this is exactly what I want.
My question is, is there any 'easier' and 'better' DAX to get this result other than what I have created here.
Code:
[FONT=Calibri]=if(HASONEVALUE(Products[ProdDesc])[/FONT]
[FONT=Calibri] ,DIVIDE([Total Sales][/FONT]
[FONT=Calibri] ,CALCULATE([Total Sales][/FONT]
[FONT=Calibri] ,all(Products)[/FONT]
[FONT=Calibri] ,VALUES(Products[Pack Size])[/FONT]
[FONT=Calibri] )[/FONT]
[FONT=Calibri] )[/FONT]
[FONT=Calibri] ,DIVIDE([Total Sales][/FONT]
[FONT=Calibri] ,CALCULATE([Total Sales][/FONT]
[FONT=Calibri] ,all(Products)[/FONT]
[FONT=Calibri] )[/FONT]
[FONT=Calibri] )[/FONT]
[FONT=Calibri] )[/FONT]
Thanks