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

Join us for an expert-led overview of the tools and concepts you'll need to become a Certified Power BI Data Analyst and pass exam PL-300. Register 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
Super User
Super User

@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
Super User
Super User

@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
Super User
Super User

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
July PBI25 Carousel

Power BI Monthly Update - July 2025

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

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 community update carousel

Fabric Community Update - June 2025

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