Skip to main content
cancel
Showing results for 
Search instead for 
Did you mean: 

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.

Reply
Anonymous
Not applicable

Running Sum

Wanted to create a report like as below.What would be best DAX formula to calucate sum of sales and %.

 

ProductSalesSum of Sales
Category A1010010%
Category B2010020%
Category C3010030%
Category D4010040%
1 ACCEPTED SOLUTION
Mariusz
Community Champion
Community Champion

HI @Anonymous 

 

Try something like.

Measure = 
DIVIDE(
    SUM( 'Table'[Sales] ),
    CALCULATE(
        SUM( 'Table'[Sales] ),
        ALL( 'Table' )
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

View solution in original post

3 REPLIES 3
Ashish_Mathur
Super User
Super User

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.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/
Mariusz
Community Champion
Community Champion

HI @Anonymous 

 

Try something like.

Measure = 
DIVIDE(
    SUM( 'Table'[Sales] ),
    CALCULATE(
        SUM( 'Table'[Sales] ),
        ALL( 'Table' )
    )
)

 

Best Regards,
Mariusz

If this post helps, then please consider Accepting it as the solution.

Please feel free to connect with me.
LinkedIn

 

Anonymous
Not applicable

thanks ,this working. Small correction.There is a filter. 

Measure =
DIVIDE(
    SUM( 'Table'[Sales] ),
    CALCULATE(
        SUM( 'Table'[Sales] ),
        ALLSELECTED( 'Table' )
    )
)

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

Find out what's new and trending in the Fabric Community.