Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and a 50 percent discount on exams.
Get startedEarn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.
Hi,
Please can you help. Below is a picture of the subtotal FP Sales % I am trying to achieve.
It works when I only have Rep_Grp and Rep_SC in the pivot table. But when I add Prod_Rep, Rep_Desc and RRP it does not work.
I am using:
FP Sales % = [Total FP Sales] / CALCULATE ( [Total FP Sales] , All ( Products [Rep_Grp]))
Thanks
Sam
Hi @SamTaylor ,
Could you tell me if your problem has been solved?
If it is, kindly Accept it as the solution. More people will benefit from it.
Or you are still confused about it, please provide me with more details about your table and your problem or share me with your pbix file from your Onedrive for Business.
Best Regards,
Stephen Tao
Hi @SamTaylor ,
For the issue of subtotal not working properly, HASONEVALUE function might be the solution
There is a similar post, please kindly refer to:
Best Regards,
Stephen Tao
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
@SamTaylor , Not very clear. You can Try
FP Sales % = [Total FP Sales] / CALCULATE ( [Total FP Sales] , All ( Products ))
You can also use allexcept as per need
Change the column as per need. This means to remove all filter except Rep_Grp
FP Sales % = [Total FP Sales] / CALCULATE ( [Total FP Sales] , allexcept (Products , Products [Rep_Grp]))
https://www.sqlbi.com/articles/using-allexcept-versus-all-and-values/
Hi @SamTaylor
What result are you looking for? What do you mean when you say it works with only Rep_Grp and Rep_SC in the pivot table but then breaks? Are Prod_Rep, Rep_Desc and RRP all in the same table as Rep_Grp and Rep_SC? Please provide data model picture too (diagram view).
It also looks like you have some filters which may be further complicating things?
The measure you have written will only clear filters on the Rep_Grp column, so it keeps filters from other columns such as Prod_Rep and Rep_Desc. If you want the percent of Grand Total, in Power BI you could just use ALL() but I don't think you have that option in Excel. So you need to determine what filters you want to remove. I can't remember if you can use ALL(Product) in Excel - that might get you close.
https://docs.microsoft.com/en-us/dax/all-function-dax
If this doesn't help, please describe what values you want as grand total and what filters you have applied, as well as your data model relationships.
Cheers!
Copying DAX from this post? Click here for a hack to quickly replace it with your own table names
Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C
I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com
User | Count |
---|---|
92 | |
87 | |
77 | |
74 | |
67 |
User | Count |
---|---|
116 | |
107 | |
88 | |
65 | |
63 |