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

Find everything you need to get certified on Fabric—skills challenges, live sessions, exam prep, role guidance, and more. Get started

Reply
Ritaf
Responsive Resident
Responsive Resident

Aggregation for category which doesn't appear at visual

Hi there,
I am trying to calculate the sum by category as I won't use this category in my visual, so I can't do it with :

Test= CALCULATE( sum('Table'[score]),ALLEXCEPT(table,'table'[abc_item_ID])).
Could this be accomplished without a calculated column?
Thanks a lot, Rita

 
1 ACCEPTED SOLUTION

Hi @Ritaf1983 ,

try this measure

mangaus1111_0-1666726624298.png

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

8 REPLIES 8
v-yangliu-msft
Community Support
Community Support

Hi  @Ritaf ,

 

Here are the steps you can follow:

1. Create calculated table.

Table 2 =
SUMMARIZE('Table',[CusOrder],[PORDER],[Customer],[CatalogID],"TotalUnitsPurchased",
SUMX(FILTER(ALL('Table'),'Table'[CatalogID]=EARLIER('Table'[CatalogID])),[POuniysQuantity]))

2. Result:

vyangliumsft_0-1666577200706.png

If you need pbix, please click here.

 

Best Regards,

Liu Yang

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

Thanks for your assistance.
Are you sure that your solution is better than the calculated column I created: 

QTYbyCorder = sumx(filter('factOrdersPurchase',factOrdersPurchase[OrdersCustomerItemId]=EARLIER(factOrdersPurchase[OrdersCustomerItemId])),'factOrdersPurchase'[QTY])
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile
mangaus1111
Solution Sage
Solution Sage

Hi @Ritaf ,

see my pbi file. Let me know if the link does not work.

 

https://1drv.ms/u/s!Aj45jbu0mDVJiyMYU1Vqkgf7UrWI?e=SlISVu

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

mangaus1111
Solution Sage
Solution Sage

Hi , could you please send us a sample table and your expected result?

Thanks for your assistance.
Are you sure that your solution is better than the calculated column I created: 

QTYbyCorder = sumx(filter('factOrdersPurchase',factOrdersPurchase[OrdersCustomerItemId]=EARLIER(factOrdersPurchase[OrdersCustomerItemId])),'factOrdersPurchase'[QTY])
Since this measure is one of many in this report, I don't need another table. However, I know that earlier is a very wasteful function, so I wondered if there was a way to calculate it with a measure using a virtual table.
Regards,
Rita Fainshtein | Microsoft MVP
https://www.linkedin.com/in/rita-fainshtein/
Blog : https://www.madeiradata.com/profile/ritaf/profile

Hi @Ritaf1983 ,

try this measure

mangaus1111_0-1666726624298.png

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

Ritaf
Responsive Resident
Responsive Resident

That's great! The solution I was looking for! I appreciate your help 🙂

Ritaf
Responsive Resident
Responsive Resident

Hello,
I have attached a picture of the data and the expected result.
For every OrdersCustomerItemId, I need to calculate the sum of POunitsQuantity without using OrdersCustomerItemId in the visual.
Right now I am using a calculated column with an earlier function, and I am wondering if there is a better way to accomplish this.
Thank you, RitaCapture.JPG

 

Helpful resources

Announcements
Europe Fabric Conference

Europe’s largest Microsoft Fabric Community Conference

Join the community in Stockholm for expert Microsoft Fabric learning including a very exciting keynote from Arun Ulag, Corporate Vice President, Azure Data.

AugPowerBI_Carousel

Power BI Monthly Update - August 2024

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

August Carousel

Fabric Community Update - August 2024

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