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
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])))

Full Power BI Video 20 Hours YouTube
Microsoft Fabric Series 60+ Videos YouTube
Microsoft Fabric Hindi End to End YouTube

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
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! Prices go up Feb. 11th.

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.

Jan NL Carousel

Fabric Community Update - January 2025

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

Top Solution Authors