Forum Discussion
5B
2 years agoRegular Visitor
Assistance Needed with DAX Calculation
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 S...
- 2 years ago
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/
tackytechtom
2 years agoMost Valuable Professional
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/
- 5B2 years agoRegular Visitor
Hey Tom,
It worked! Thank you.
I added in
FILTER(ALL('Table'), 'Table'[Date] IN VALUES('Table'[Date]))
Really appreciate it!