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

Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.

Reply
CrazyExcelor
New Member

Medidas condicionales - Diferentes condiciones

Hola a todos,

Soy el nuevo aprendiz de Power Bi,

Me enfrento a un problema mientras creo una medida de tal manera que, estoy tomando la mesa - "Dump de datos"

Para los países IN, KR, CN, el meaure debe reflejar su respectivo recuento de documentos

y para los países TW, SG, TH, la medida debe reflejar allí un recuento diferenciado respectivo de documentos.

Mi esfuerzo:

DocCount ? CALCULATE(IF('Data Dump'[País] ? "KR" ( "KR" ( KR" ) "CN", COUNT('Data Dump'[Doc]), DISTINCTCOUNT('Data Dump'[Doc]))

Pic.png

7 REPLIES 7
v-diye-msft
Community Support
Community Support

Hola @CrazyExcelor

Prueba éste:

DocCount = 
IF (
    MAX('Data Dump'[Country]) IN { "IN", "KR", "CN" },
   COUNT ( 'Data Dump'[Doc] ),
    DISTINCTCOUNT ( 'Data Dump'[Doc] )
)

09.PNG

Pbix unido,

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

¿Puedo saber, por qué ha utilizado max aquí ?

Hola @CrazyExcelor

Es para especificar el valor actual en la columna.

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

@CrazyExcelor , Probar como

DocCount ? CALCULATE(IF('Data Dump'[País] en 'IN' , "KR" , "CN"' , COUNT('Data Dump'[Documento de ventas]), DISTINCTCOUNT('Data Dump'[Documento de ventas])))

El problema al que me enfrento es, SI no está tomando la columna no medida como un valor .. no está detectando 'Data Dump'[País]

jdbuchanan71
Super User
Super User

@CrazyExcelor

Prueba esto.

DocCount =
IF (
    'Data Dump'[Country] IN { "IN", "KR", "CN" },
    COUNT ( 'Data Dump'[Sales Document] ),
    DISTINCTCOUNT ( 'Data Dump'[Sales Document] )
)

El problema al que me enfrento es, SI no está tomando la columna no medida como un valor .. no está detectando 'Data Dump'[País]

Helpful resources

Announcements
Microsoft Fabric Learn Together

Microsoft Fabric Learn Together

Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City

PBI_APRIL_CAROUSEL1

Power BI Monthly Update - April 2024

Check out the April 2024 Power BI update to learn about new features.

April Fabric Community Update

Fabric Community Update - April 2024

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