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
UsePowerBI
Post Prodigy
Post Prodigy

How to create sum functions for graphs?

Hello

 

I have a table like:

Product, Client, Price, Profit, Units, etc

 

I want to calculate some sums eg:

1) sum of units per product

2) sum of units per client

3) sum of profits per client

etc

 

How can I calculate these and then how can I put them in a graph like:

1) x axis = product, y axis = sum of units per product

2) x axis = client, y axis = sum of profits per client

 

Thanks!

1 ACCEPTED SOLUTION
v-shex-msft
Community Support
Community Support

HI @UsePowerBI,

You can try to use the following measure formulas if they meet your requirement:

Measure 1 =
CALCULATE (
    SUM ( Table[Unit] ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Product] )
)

Measure 2 =
CALCULATE (
    SUM ( Table[Unit] ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Client] )
)

Measure 3 =
CALCULATE (
    SUM ( Table[Profit] ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Client] )
)

If above not help, please hare some dummy data to test:
How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.

View solution in original post

2 REPLIES 2
v-shex-msft
Community Support
Community Support

HI @UsePowerBI,

You can try to use the following measure formulas if they meet your requirement:

Measure 1 =
CALCULATE (
    SUM ( Table[Unit] ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Product] )
)

Measure 2 =
CALCULATE (
    SUM ( Table[Unit] ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Client] )
)

Measure 3 =
CALCULATE (
    SUM ( Table[Profit] ),
    ALLSELECTED ( Table ),
    VALUES ( Table[Client] )
)

If above not help, please hare some dummy data to test:
How to Get Your Question Answered Quickly 

Regards,

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
Tahreem24
Super User
Super User

@UsePowerBI ,
Create different measures like:

 

sum of units per product = CALCULATE(SUM(Table[Unit]),ALLEXCEPT(Table,Table[Product]))

sum of units per client = CALCULATE(SUM(Table[Unit]),ALLEXCEPT(Table,Table[Client]))

sum of profits per client = CALCULATE(SUM(Table[Profit]),ALLEXCEPT(Table,Table[Client]))

And put them in charts.

Don't forget to give thumbs up and accept this as a solution if it helped you!!!

Please take a quick glance at newly created dashboards : Restaurant Management Dashboard , HR Analytics Report , Hotel Management Report, Sales Analysis Report , Fortune 500 Companies Analysis , Revenue Tracking Dashboard

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.