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

Vote for your favorite vizzies from the Power BI Dataviz World Championship submissions. Vote now!

Reply
Anonymous
Not applicable

¿Cómo crear un subtotal para Column en una tabla? Mi medida no está funcionando.

Hola
Estoy tratando de obtener el subtotal para Net_Claim_Amt por PrimaryName y Year, pero cuando agredo mi medida calculada, no creo que funcione para PrimaryName. Para el Año no funciona en absoluto, de alguna manera y algunos de los números de columna desaparecerán.

¿Alguien puede decirme cómo arreglar esto?
Mis fórmulas -

Sub_Total_For_Year = CALCULATE([Net_Claim_Amt], ALLEXCEPT('XL-Hargrove_MpciPolicy_Data','XL-Hargrove_MpciPolicy_Data'[Year]))
Sub_Total_For_PrimaryName = CALCULATE([Net_Claim_Amt], ALLEXCEPT(Grower,Grower[ PrimaryName]))

Claim_amt = [Max_$_Guar] - [Harvest_Value]
Max_$_Guar = SUM('XL-Hargrove_MpciPremLine_Data'[Guar in lb or bu]) * [MAX_Price]
Harvest_Value = SUM(PriceKeys[ HarvestPrice]) * SUM('XL-Hargrove_ProductionReported_Data'[ TotalProductionAmount])

* MAX_Price also calculated Measure

Datos con Subtotales,
En éste, usted puede ver que no está sumando Net_Claim_Amount para el nombre primario. Sólo quiero obtener total Net_Claim_Amount para el nombre de la Primaria.
Primary Name.PNG

Por aquí, Cuando agredo algunos de los valores de columna faltan y no funciona. Lo mismo aquí, sólo necesito el monto total de la reclamación por año.

Year.PNG

Con suerte, todas las cosas anteriores tienen sentido. Cualquier ayuda realmente lo apreciará.

Muchas gracias
5 REPLIES 5
AllisonKennedy
Community Champion
Community Champion

@dhanaleisurequ Tienes muchas relaciones bidireccionales. Sin conocer sus datos, no puedo estar seguro, pero estos normalmente no son necesarios y pueden causar problemas. Vea este post y video aquí, es la mejor explicación que he visto hasta ahora: https://www.sqlbi.com/articles/bidirectional-relationships-and-ambiguity-in-dax/

Veré si puedo averiguar su otro problema, pero lo más probable es que primero necesite corregir su modelo de datos.


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

AllisonKennedy
Community Champion
Community Champion

@dhanaleisurequ ¿Puede compartir la captura de pantalla de las relaciones para todas estas tablas? Y en realidad, al mirar esto de nuevo podrías haber estado en lo correcto con ALLEXCEPT, lo siento, es el fin de semana y mi cerebro no está disparando en todos los cilindros! 😛


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

@AllisonKennedy Muchas gracias por la ayuda.

Por favor, consulte el enlace. Creo que obtendrás más ideas que una captura de pantalla. Tengo todo en mi mesa de medidas. También filtro para dos nombres principales (de lo contrario se pondrá desordenado). Ignore el nombre principal, ya que se trata de datos de ejemplo (el nombre principal no tiene ningún sentido cuando lo recorte)

https://drive.google.com/file/d/1heoTuzrvhC5yFHPGsxoGTe0ECzHS7gfQ/view?usp=sharing

Te agradezco mucho que me ayudes con esto.

Una vez más, Gracias

AllisonKennedy
Community Champion
Community Champion

Intente usar ALL(Year) y ALL(PrimaryName) en lugar de ALLEXCEPT. ALLEXCEPT mantiene el filtro en las columnas especificadas. Suena como si quisiera ignorar el filtro en PrimaryName y Year. Además, debe intentar agregar Year desde la tabla DimDate en su lugar y ver si eso devuelve los valores que faltan. Utilícelo también en la función ALL().


Please @mention me in your reply if you want a response.

Copying DAX from this post? Click here for a hack to quickly replace it with your own table names

Has this post solved your problem? Please Accept as Solution so that others can find it quickly and to let the community know your problem has been solved.
If you found this post helpful, please give Kudos C

I work as a Microsoft trainer and consultant, specialising in Power BI and Power Query.
www.excelwithallison.com

Anonymous
Not applicable

Hola @AllisonKennedy

Muchas gracias, intenté después de que me dijeras que lo hiciera, aún no tuve suerte. No funcionó para mí. Me cansé tanto del nombre de Year como de La Primaria. Por favor, dime si hice algo mal o cualquier otra idea.

Sub_Total_For_PrimaryName = CALCULATE([Net_Claim_Amt], ALL(Grower[ PrimaryName]))
Sub_Total_For_Year = CALCULATE([Net_Claim_Amt], ALL('XL-Hargrove_MpciPolicy_Data'[Year]))


er1.PNG

Una vez más, muchas gracias por su tiempo y ayuda.

Helpful resources

Announcements
Power BI DataViz World Championships

Power BI Dataviz World Championships

Vote for your favorite vizzies from the Power BI World Championship submissions!

Sticker Challenge 2026 Carousel

Join our Community Sticker Challenge 2026

If you love stickers, then you will definitely want to check out our Community Sticker Challenge!

January Power BI Update Carousel

Power BI Monthly Update - January 2026

Check out the January 2026 Power BI update to learn about new features.

FabCon Atlanta 2026 carousel

FabCon Atlanta 2026

Join us at FabCon Atlanta, March 16-20, for the ultimate Fabric, Power BI, AI and SQL community-led event. Save $200 with code FABCOMM.

Top Kudoed Authors