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

Don't miss out! 2025 Microsoft Fabric Community Conference, March 31 - April 2, Las Vegas, Nevada. Use code MSCUST for a $150 discount. Prices go up February 11th. Register now.

Reply
SimonGoldPPG
Frequent Visitor

Gran total que no muestra el valor correcto al usar SUMX y Countrows

Tengo problemas para obtener el valor correcto en el Total General usando la siguiente Medida.

Días activos de la instalación:
SUMX('Región de facilidad', COUNTROWS(DISTINCT('Censo diario global'[CensusDate])))

La región del mecanismo es una tabla de dimensiones con una relación entre uno y muchos con el Censo Diario Global.

Espero que la medida para itirate la tabla Región de Fciilidad, y cuente los valores de fecha distintos para cada instalación y resuma los resultados.

los resultados se muestran correctamente cuando se utilizan los nombres de facilidad en las filas y cada instalación muestra la cantidad correcta de Fecha única, Sin embargo, el total general simplemente muestra una multiplicación del total de filas en la tabla de región de instalación, multiplicando por el recuento único más grande de la columna de fecha.

Mi modelo está construido en SSAS tabular y el siguiente es un recorte de Excel del resultado.

El Gran Total para Días Activos de Instalaciones debería haber sido 150, pero muestra 186.

SimonGoldPPG_0-1602194682448.png

Gracias

1 ACCEPTED SOLUTION
amitchandak
Super User
Super User

@SimonGoldPPG , Suponiendo que la etiqueta de fila es region, Try like like

SUMX(values('Facility Region'[Region]), calculate(COUNTROWS(DISTINCT('Global Daily Census'[CensusDate])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

View solution in original post

3 REPLIES 3
amitchandak
Super User
Super User

@SimonGoldPPG , Suponiendo que la etiqueta de fila es region, Try like like

SUMX(values('Facility Region'[Region]), calculate(COUNTROWS(DISTINCT('Global Daily Census'[CensusDate])))

Join us as experts from around the world come together to shape the future of data and AI!
At the Microsoft Analytics Community Conference, global leaders and influential voices are stepping up to share their knowledge and help you master the latest in Microsoft Fabric, Copilot, and Purview.
️ November 12th-14th, 2024
 Online Event
Register Here

Adición de Calcular trabajado.

Gracias

v-yiruan-msft
Community Support
Community Support

Hola @SimonGoldPPG ,

Actualice la fórmula de medida[Días activos de la instalación] como se indica a continuación y compruebe si puede obtener los valores totales generales correctos:

Facility Active Days :=
SUMX (
    VALUES ( 'Facility Region'[Facilitiy Name] ),
    COUNTROWS ( DISTINCT ( 'Global Daily Census'[CensusDate] ) )
)

También puede hacer referencia a los métodos de los siguientes vínculos para resolverlo.

Por qué su total es incorrecto en Power BI - El concepto de DAX clave para entender

Obtención de totales precisos en DAX

Dax para Power BI: corrección de totales de medida incorrectos

Si todavía no puede obtener el resultado correcto, proporcione algunos datos de ejemplo en su modelo (excluir datos confidenciales).

Saludos

Rena

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

Helpful resources

Announcements
Las Vegas 2025

Join us at the Microsoft Fabric Community Conference

March 31 - April 2, 2025, in Las Vegas, Nevada. Use code MSCUST for a $150 discount!

Jan25PBI_Carousel

Power BI Monthly Update - January 2025

Check out the January 2025 Power BI update to learn about new features in Reporting, Modeling, and Data Connectivity.

December 2024

A Year in Review - December 2024

Find out what content was popular in the Fabric community during 2024.

Top Solution Authors
Top Kudoed Authors