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

Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!

Reply
Anonymous
Not applicable

Uso de SUMX y su sintaxis

¿Puede alguien explicar el siguiente DAX? Cuando se supone que SUMX tiene "Table" como su primer argumento, el código siguiente tiene la expresión de columna como su primer parámetro. ¿Es el uso correcto cuando se supone que la sintaxis correcta es "Tabla" como yth

[ventas de los 10 mejores productos vendidos]
• SUMX(
TOPN(
10,
RESUMEN(Producto, [ProductKey], "TotalSales",
SUMX(RELATED(InternetSales_USD[SalesAmount_USD]),InternetSales_USD[SalesAmount_USD]) +
SUMX(RELATED(ResellerSales_USD[SalesAmount_USD]), ResellerSales_USD[SalesAmount_USD]))
)
)

4 REPLIES 4
v-shex-msft
Community Support
Community Support

HAY @RADHIKA_3022,

Tal vez usted puede echar un vistazo al siguiente blog, que menciona el uso de 'usar el trabajo de función relacionada como filtros':
Filtro DAX - Función RELACIONADA

saludos

Xiaoxin Sheng

Community Support Team _ Xiaoxin
If this post helps, please consider accept as solution to help other members find it more quickly.
amitchandak
Super User
Super User

@RADHIKA_3022, dudo que necesites información.

Crea dos medidas como estas

TotalSales á InternetSales_USD[SalesAmount_USD] +ResellerSales_USD[SalesAmount_USD]

Top 10 Rango de ciudad á CALCULATE([TotalSales],TOPN(10,all(Product[ProductKey]),[TotalSales],DESC),VALUES(Product[ProductKey]))

Para TOPN Consulte : https://www.youtube.com/watch?v=QIVEFp-QiOk

en caso de sumx relacionado vendrá en el nombre de la columna

Ejemplo

SUMX(Producto,RELATED(InternetSales_USD[SalesAmount_USD]))

AllisonKennedy
Super User
Super User

@RADHIKA_3022 ¿Se trata de sus datos o archivo de ejemplo? SuMX primer argumento es una tabla o expresión de tabla, por lo que TOPN devuelve una tabla, en su caso con 10 filas.


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

Gracias por responder.

Pero "Related" en la expresión SUMX devuelve un valor escalar, que no es una expresión de tabla/tabla.. cuando se supone que SUMX tiene TABLE de valores como su primer argumento. Espero que entiendas mi punto.

Helpful resources

Announcements
April AMA free

Microsoft Fabric AMA Livestream

Join us Tuesday, April 09, 9:00 – 10:00 AM PST for a live, expert-led Q&A session on all things Microsoft Fabric!

March Fabric Community Update

Fabric Community Update - March 2024

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

Top Solution Authors