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

Get Fabric Certified for FREE during Fabric Data Days. Don't miss your chance! Learn more

Reply
Jhophshepht
Frequent Visitor

measure dax %

Hola, tengo una medida que no puedo generar hace dias, resulta que tengo mi tabla llamada TABLA, dentro tengo varias columnas, una de esas es "Número de documento" y otra llamada "IRA", el numero de documento es la contabilizacion en sapb1 por lo cual tiene varias lineas, en la columna "IRA" tengo el porcentaje de cumplimiento de cada documento que esta en porcentaje, al obtener esta informacion, me arroja ese porcentaje en cada lina del documento y si este tiene 20 lineas, 20 veces se repite el porcentaje, estoy haciendo un informe referente a movimientos de inventario y necesito sacar el porcentaje de cumplimiento por dia, por mes y por año, para eso necesito crear una medida que me busque los valores unico de la columna "Número de documento" y con este filtro, me entregue el valor de la columna "IRA" que ahora solo mostrara un valor.

 

Favor su ayuda.

1 ACCEPTED SOLUTION
Anonymous
Not applicable

Hi @Jhophshepht 

 

To make the total correct, you may create a new measure:

Measure = AVERAGEX(VALUES('Table'[Número de documento]),[IRA Value])

[IRA Value] is the old measure: 

IRA Value = MAX('Table'[IRA])

 

The "incorrect total" behavior is common in table/matrix visuals in Power BI, you can refer to the following blogs about how to deal with it. This occurs because Power BI intends to calculate the total based on rows of underlying data instead of the rows displayed in the visual.  

Why Power BI totals might seem inaccurate - SQLBI

Obtaining accurate totals in DAX - SQLBI

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

View solution in original post

7 REPLIES 7
Anonymous
Not applicable

Hi @Jhophshepht 

 

Not sure if I understand it correctly. If your table is similar to below, you can create a simple measure with MAX to get the distinct IRA value for each Número de documento on each date. 

IRA Value = MAX('Table'[IRA])

vjingzhanmsft_0-1713512229802.pngvjingzhanmsft_1-1713512325340.png

 

If this is not what you want, can you provide some dummy data and expected result to show what you want to accomplish?

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

 

Gracias por la respuesta, estoy cerca. me da la informacion que necesito, pero el total de la columna no es el correcto, deberia ser 89.10%

Jhophshepht_0-1713537262348.png

 

Si uso la funcion Average, me da el promedio de toda la columna, pero tampoco es el correcto, me da 83.52% 

Jhophshepht_0-1713539598131.png

 

Anonymous
Not applicable

Hi @Jhophshepht 

 

To make the total correct, you may create a new measure:

Measure = AVERAGEX(VALUES('Table'[Número de documento]),[IRA Value])

[IRA Value] is the old measure: 

IRA Value = MAX('Table'[IRA])

 

The "incorrect total" behavior is common in table/matrix visuals in Power BI, you can refer to the following blogs about how to deal with it. This occurs because Power BI intends to calculate the total based on rows of underlying data instead of the rows displayed in the visual.  

Why Power BI totals might seem inaccurate - SQLBI

Obtaining accurate totals in DAX - SQLBI

 

Best Regards,
Jing
If this post helps, please Accept it as Solution to help other members find it. Appreciate your Kudos!

Muchas gracias, funciono, era lo que necesitaba.

en excel, si da el calculo bien, en que estare fallando, sera que promedia el valor de toda la columna sin diferenciar los valores que se muestran en la tabla?

Jhophshepht_0-1713541279752.png

 

sigo probando cosas y cree un tabla aparte solo con los datos de la primera tabla, pero el IRA como columna y si me da el promedio correcto, el problema se da con la medida, no se con que otros valores esta filtrando el promedio, comparto mi tabla, si se fijan ya tiene la columna IRA, ya sea que cree la medida o use esa columna el valor es el mismo.

Jhophshepht_0-1713546133556.png

Número de documentoFechaDiaMesAñoNúmero de artículoCódigo de almacénSku ContadosSku CuadradosIRA
23100131918-04-202418Abril2024181031738VA0203201890,00%
23100131818-04-202418Abril202412341820VA0201151173,33%
23100131217-04-202417Abril2024165021582VA02031616100,00%
23100131117-04-202417Abril202412435228VA02011010100,00%
23100130816-04-202416Abril202412453312VA0201161487,50%
23100130716-04-202416Abril2024105020990VA0203241979,17%
23100130515-04-202415Abril2024164031363VA02032020100,00%
23100130415-04-202415Abril202412311118VA020177100,00%
23100129711-04-202411Abril2024174061648VA0203161487,50%
23100129310-04-202410Abril202412449850VA02011010100,00%
23100129210-04-202410Abril2024104020038VA0203171270,59%
23100128609-04-20249Abril2024118047940VA02032828100,00%
23100128509-04-20249Abril202412364416VA0201231982,61%
23100128208-04-20248Abril2024126028743VA0203302273,33%
23100127804-04-20244Abril2024183021975VA0203322784,38%
23100127704-04-20244Abril202412452915VA0201272592,59%
23100127403-04-20243Abril202412450588VA0201222090,91%
23100127203-04-20243Abril2024187032234VA0203272385,19%
23100126702-04-20242Abril2024154047966VA0203311961,29%
23100126602-04-20242Abril202412341824VA0201161275,00%

 

Helpful resources

Announcements
Fabric Data Days Carousel

Fabric Data Days

Advance your Data & AI career with 50 days of live learning, contests, hands-on challenges, study groups & certifications and more!

October Power BI Update Carousel

Power BI Monthly Update - October 2025

Check out the October 2025 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 Solution Authors