Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Wanted to create a report like as below.What would be best DAX formula to calucate sum of sales and %.
Product | Sales | Sum of Sales | % |
Category A | 10 | 100 | 10% |
Category B | 20 | 100 | 20% |
Category C | 30 | 100 | 30% |
Category D | 40 | 100 | 40% |
Solved! Go to Solution.
HI @Anonymous
Try something like.
Measure =
DIVIDE(
SUM( 'Table'[Sales] ),
CALCULATE(
SUM( 'Table'[Sales] ),
ALL( 'Table' )
)
)
Hi,
Write these measures:
Sales = SUM(Data[Sale])
Sales of all products = CALCULATE([Sales],ALL(Data[Product]))
Sales share = [Sales]/[Sales of all products]
Hope this helps.
HI @Anonymous
Try something like.
Measure =
DIVIDE(
SUM( 'Table'[Sales] ),
CALCULATE(
SUM( 'Table'[Sales] ),
ALL( 'Table' )
)
)
thanks ,this working. Small correction.There is a filter.
Measure =
DIVIDE(
SUM( 'Table'[Sales] ),
CALCULATE(
SUM( 'Table'[Sales] ),
ALLSELECTED( 'Table' )
)
)
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
112 | |
96 | |
78 | |
68 | |
55 |
User | Count |
---|---|
145 | |
105 | |
104 | |
90 | |
63 |