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

Get certified in Microsoft Fabric—for free! For a limited time, get a free DP-600 exam voucher to use by the end of 2024. Register now

Reply
Syndicate_Admin
Administrator
Administrator

Calculate a measure to get a grouped value

Good

I have a table with the fields of org, date, mat, plan and quantity. I would like to get the sum of the quantity grouped by org, date, mat, leaving aside the plant. What I want is that, when I represent that measure in a table visualization where the org, mat, date, and plan fields come out, the field comes out grouped without taking into account the plan.

I have made this measure:

agrup_quantity =
SUMX(
SUMMARIZE(Hoja1,
Hoja1[org],
Hoja1[date],
Hoja1[food]),
SUM(Hoja1[quantity])
)

But I get the following:

gerardcanals_0-1694761658753.png

What I want is for the agrup_quantity to be 56 in the two rows, instead of 53 and 3. How can I do it?

I have made a very simplified case, actually the fields are in other tables, but at least I would like to know how it is done in a model as simple as the one mentioned.

I've also tried it with the values() function, but nothing. It's strange because on other occasions it had worked for me.

1 ACCEPTED SOLUTION

Hi @Syndicate_Admin ,

 

The SUMMARIZE function has a grouping role. You can change your measure as needed. You can refer to the following documentation for more information about this function:

SUMMARIZE – DAX Guide

 

Best Regards,

Neeko Tang

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

4 REPLIES 4
Syndicate_Admin
Administrator
Administrator

Thanks a lot!!

In the end I have done it without the "SUMMARIZE". I have directly done:

Measure = CALCULATE( SUM(Hoja1[quantity]), ALL(Hoja1[plan])

I think that with this I already get the desired result, can it be? Or is it possible that it will fail in some case?

Hi @Syndicate_Admin ,

 

The SUMMARIZE function has a grouping role. You can change your measure as needed. You can refer to the following documentation for more information about this function:

SUMMARIZE – DAX Guide

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

v-tangjie-msft
Community Support
Community Support

Hi @Syndicate_Admin ,

 

According to your description, here are my steps you can follow as a solution.

(1) This is my test data.

vtangjiemsft_0-1695000900307.png

(2) We can create measures. 

agrup_quantity = 
SUMX(
SUMMARIZE(Hoja1,
Hoja1[org],
Hoja1[date],
Hoja1[food]),
SUM(Hoja1[quantity])
)
Measure = SUMX(ALL('Hoja1'),[agrup_quantity])

(3) Then the result is as follows.

vtangjiemsft_1-1695000959497.png

 

If the above one can't help you get the desired result, please provide some sample data in your tables (exclude sensitive data) with Text format and your expected result with backend logic and special examples. It is better if you can share a simplified pbix file. Thank you.

 

Best Regards,

Neeko Tang

If this post  helps, then please consider Accept it as the solution  to help the other members find it more quickly. 

lbendlin
Super User
Super User

Please provide sample data (with sensitive information removed) that covers your issue or question completely, in a usable format (not as a screenshot). Leave out anything not related to the issue.
https://community.fabric.microsoft.com/t5/Community-Blog/How-to-provide-sample-data-in-the-Power-BI-...
Please show the expected outcome based on the sample data you provided.

https://community.fabric.microsoft.com/t5/Desktop/How-to-Get-Your-Question-Answered-Quickly/m-p/1447...

Helpful resources

Announcements
November Carousel

Fabric Community Update - November 2024

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

Live Sessions with Fabric DB

Be one of the first to start using Fabric Databases

Starting December 3, join live sessions with database experts and the Fabric product team to learn just how easy it is to get started.

Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount! Early Bird pricing ends December 9th.

Nov PBI Update Carousel

Power BI Monthly Update - November 2024

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