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

Power BI is turning 10! Let’s celebrate together with dataviz contests, interactive sessions, and giveaways. Register now.

Reply
khush19
Resolver I
Resolver I

Suma de valores máximos

Hola

Tengo debajo de la tabla, tenga en cuenta que es sólo los datos de smaple

Quiero calcular SUM encima de MAX.

Max se calcula en la agrupación CustomerID,AreaID y date, y una vez que se calcula max necesita sumar datos basados en CUstomerID y Date.

CustomeridAreaIDFechaCantidadImporte máximoSuma Importe
1x6/04/2020101040
1y6/04/2020203040
1y6/04/2020303040
1x5/04/2020102020
1x5/04/2020202020
2u6/04/2020102050
2z6/04/202053050
2u6/04/2020202050
2z6/04/2020303050
2z6/04/2020153050

en mis informes tendré tarjeta que mostrará El Importe Total por un día para un cliente.

Por lo tanto, si el CustomerID 1 y la fecha es 6/04/2020, entonces la tarjeta debe mostrar 40

si el Id.DeC 1 y la fecha es 5/04/2020, entonces la tarjeta debe mostrar 20

si el Id.2 del cliente y la fecha es 6/04/2020, la tarjeta debe mostrar 50

Soy capaz de calcular MAX, a continuación es mi medida:

MaxAmount ?
CALCULATE(MAX(RealReport[Amount]),ALLEXCEPT(RealReport,RealReport[CustomerID],RealReport[AreaID],RealReport[Date]))
Traté de calcular SUM, pero no viene como se esperaba:
TotalCalculatedAmount ?
SUMX(ALLEXCEPT(RealReport,RealReport[CustomerID],RealReport[Date]),[MaxAmount])
También intenté :
Medida ?
SUMX
(SUMMARIZE(RealReport,RealReport[CustomerID],RealReport[Date],"Max Amount",CALCULATE(MAX(RealReport[Amount]),ALLEXCEPT(RealReport,RealReport[CustomerID],RealReport[date],RealReport[AreaID]))),[Max Amount])
¿Cómo conseguir la suma?
4 REPLIES 4
Greg_Deckler
Super User
Super User

Esto parece un problema de agregación de medidas. Vea mi artículo de blog sobre eso aquí: https://community.powerbi.com/t5/Community-Blog/Design-Pattern-Groups-and-Super-Groups/ba-p/138149



Follow on LinkedIn
@ me in replies or I'll lose your thread!!!
Instead of a Kudo, please vote for this idea
Become an expert!: Enterprise DNA
External Tools: MSHGQM
YouTube Channel!: Microsoft Hates Greg
Latest book!:
Power BI Cookbook Third Edition (Color)

DAX is easy, CALCULATE makes DAX hard...
Ashish_Mathur
Super User
Super User

Hola

Puede descargar mi archivo PBI desde aquí.

Espero que esto ayude.

Untitled.png


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Gracias Ashish,

Nunca pensé que las medidas que creaste funcionarán como se ve tan ordenada y simple, fue un gran aprendizaje

De nada.


Regards,
Ashish Mathur
http://www.ashishmathur.com
https://www.linkedin.com/in/excelenthusiasts/

Helpful resources

Announcements
Join our Fabric User Panel

Join our Fabric User Panel

This is your chance to engage directly with the engineering team behind Fabric and Power BI. Share your experiences and shape the future.

June 2025 Power BI Update Carousel

Power BI Monthly Update - June 2025

Check out the June 2025 Power BI update to learn about new features.

June 2025 community update carousel

Fabric Community Update - June 2025

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

Top Solution Authors