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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

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
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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