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

Grow your Fabric skills and prepare for the DP-600 certification exam by completing the latest Microsoft Fabric 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
RTI Forums Carousel3

New forum boards available in Real-Time Intelligence.

Ask questions in Eventhouse and KQL, Eventstream, and Reflex.

MayPowerBICarousel

Power BI Monthly Update - May 2024

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