Join us at FabCon Atlanta from March 16 - 20, 2026, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.
Register now!View all the Fabric Data Days sessions on demand. View schedule
Hi all,
I'm new to Power Bi and I'm having an issue with a calculation. I am trying to calculate the share of sales an item holds. This is done by dividing the number of items sold by the Total Sales of a selected period. Using the sample table below:
Total Sales = 14,700 (2500+9000+1500+1700)
Sales Share (Soft Drink) = Qty / Total Sales
= 100 / 14700 = 0.006802721
| Description | Qty | Total Sales | Sales Share |
| Soft Drink | 100 | 2500 | 0.006802721 |
| Pizza | 57 | 9000 | 0.003877551 |
| Burger | 25 | 1500 | 0.00170068 |
| Sandwich | 17 | 1700 | 0.001156463 |
Best regards,
Stephanie.
Solved! Go to Solution.
Hi @5B ,
How about this:
Here the DAX code for the measure:
Measure =
DIVIDE (
SUM ( 'Table'[Qty] ),
CALCULATE (
SUM ( 'Table'[Total Sales] ),
ALL ( 'Table' )
)
)
Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
| Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
| Also happily accepting Kudos 🙂 |
| Feel free to connect with me on LinkedIn! | |
| #proudtobeasuperuser | |
Hi, @5B
I will try my best to help. Try this:
Hi @5B ,
How about this:
Here the DAX code for the measure:
Measure =
DIVIDE (
SUM ( 'Table'[Qty] ),
CALCULATE (
SUM ( 'Table'[Total Sales] ),
ALL ( 'Table' )
)
)
Let me know if this helps 🙂
/Tom
https://www.tackytech.blog/
https://www.instagram.com/tackytechtom/
| Did I answer your question❓➡️ Please, mark my post as a solution ✔️ |
| Also happily accepting Kudos 🙂 |
| Feel free to connect with me on LinkedIn! | |
| #proudtobeasuperuser | |
Hey Tom,
It worked! Thank you.
I added in
FILTER(ALL('Table'), 'Table'[Date] IN VALUES('Table'[Date]))
Really appreciate it!
Check out the November 2025 Power BI update to learn about new features.
Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!