cancel
Showing results for
Search instead for
Did you mean:
Highlighted
Helper I

Measure to calculate total qty by sub-category

Hi All,

I am struggling to calculate the total qty by each category. What I am currently getting is its grouped by year / month...

But what I need is, the total qty should be the overall qty of each category, and not grouped by year / month.

Appreciate your help.

Best regards,

Sumit

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Support

Re: Measure to calculate total qty by sub-category

Create a measure

``Measure = SUMX(ALL('date'[Date]),[plan measure])``

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

6 REPLIES 6
Highlighted
Resolver II

Re: Measure to calculate total qty by sub-category

You need to ignore the Year "filter" that is inherent in the table.

You do that by specifying what NOT to ignore with ALLEXCEPT:

``````measure =
CALCULATE (
SUM ( 'Table'[Quantity]),
ALLEXCEPT ( 'Table'[Unique Resource ID] )
)``````

Highlighted
Helper I

Re: Measure to calculate total qty by sub-category

Thank you @zaza , that worked but now its calculating all quantities irrespective of categories. What I need is the total qty grouped by category (and not by year).

Here is the screenshot.

Thanks again for your help.

Best regards,

Sumit

Highlighted
Resolver II

Re: Measure to calculate total qty by sub-category

My bad,

I missed an argument in ALLEXCEPT, also I assumed your category column is 'Unique Resource ID' but I might be wrong.

``````measure =
CALCULATE (
SUM ( 'Table'[Quantity]),
ALLEXCEPT ( 'Table', 'Table'[Category] )
)``````

Highlighted
Helper I

Re: Measure to calculate total qty by sub-category

Thanks again. You're right, 'Unique Resource ID' is my category, but its still not giving me the desired output, its calculating all quantities of each category and returning the value. Its not grouping by Category. Will SUMX expression help in this case?

Thanks for your help.

Best regards,

Sumit

Highlighted
Community Support

Re: Measure to calculate total qty by sub-category

Create a measure

``Measure = SUMX(ALL('date'[Date]),[plan measure])``

Best Regards
Maggie
Community Support Team _ Maggie Li
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

Highlighted
Helper I

Re: Measure to calculate total qty by sub-category

Thanks a lot, you're awesome. This is exactly what I was after. It solved my problem.

Thank you.

Best regards,

Sumit

Helpful resources

Announcements

August Community Highlights

Check out a full recap of the month!

August 2020 CYST Challenge

Check out the winners of the recent 'Can You Solve These?' community challenge!

Experience what’s next for Power BI

Join us for an in-depth look at the new Power BI features and capabilities at the free Microsoft Business Applications Launch Event.

Top Solution Authors
Top Kudoed Authors