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

Earn a 50% discount on the DP-600 certification exam by completing the Fabric 30 Days to Learn It challenge.

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
LearnSurvey

Fabric certifications survey

Certification feedback opportunity for the community.

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.