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

Enhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.

Reply
Edy_Martinez
Frequent Visitor

No se suma los totales por columna con valores RANKX dinámico , Clasificando los demás con otros.

No he podido colocar la suma total por columna utilizando RANKX, cuando tengo las tiendas como columnas,
La ultima imagen, tengo marcada la columna total en color rojo, la cual es afectada por la funcion RANKX.

¡Lo correcto seria que la columna de total este sumando!

Ranking USD:=var Items = SELECTCOLUMNS(ALL(dimClas_Otros), "RankItem", dimClas_Otros[Clasificacion 1])
var ItemsWithValue = ADDCOLUMNS(Items, "RankMeasure", CALCULATE([Total USD], all(dimClas)))

var ItemsWithRank = ADDCOLUMNS(ItemsWithValue, "Rank", RANKX(ItemsWithValue,[Total USD],, DESC, dense))

var ItemsWithTop = ADDCOLUMNS(ItemsWithRank, "TopOrOthers", IF([Rank] <= 2, [RankItem], "Otros"))
var ItemsFinal = SELECTCOLUMNS(
						FILTER(
							ItemsWithTop,
							CONTAINSROW(VALUES(dimClas_Otros[Clasificacion 1]), [TopOrOthers]) &&
							CONTAINSROW(VALUES(dimClas[Clasificacion 1]), [RankItem])),
							"TopN_Others", [RankItem])
return

SUMX(ItemsFinal,  [Total USD])

gracias por su tiempo,!
adjunto las imagenes de los datos.fctVenta.pngdimProducto.pngdimProd_Otros.pngRelacion.pngResultado.png

2 REPLIES 2
Anonymous
Not applicable

Hi @Edy_Martinez ,

 

As @lbendlin  said, we need more detailed data and expected results.

What field do you add for the values in your matrix? What kind of results do you want your totals to display?

We often use the ISINSCOPE function to represent different total results.

 

Best Regards,

Stephen Tao

 

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

lbendlin
Super User
Super User

Please provide sanitized sample data that fully covers your issue. Paste the data into a table in your post or use one of the file services. Please show the expected outcome.

Helpful resources

Announcements
July 2025 community update carousel

Fabric Community Update - July 2025

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

July PBI25 Carousel

Power BI Monthly Update - July 2025

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