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

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... 

 

Capture_PBI.JPG

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
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a measure

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

Capture3.JPG

 

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.

View solution in original post

6 REPLIES 6
v-juanli-msft
Community Support
Community Support

Hi @Anonymous 

Create a measure

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

Capture3.JPG

 

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.

Anonymous
Not applicable

@v-juanli-msft ,

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

 

Thank you.

 

Best regards,

Sumit

zaza
Resolver III
Resolver III

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] )
    )

 

Anonymous
Not applicable

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.

Capture_PBI-2.JPG

 

Thanks again for your help.

 

Best regards,

Sumit

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] )
    )

 

Anonymous
Not applicable

@zaza ,

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

 

 

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.